Add --upload_timeout bootstrap option (#2363)

This commit is contained in:
Skull Writter
2019-08-25 17:43:47 +00:00
committed by Naoki Takezoe
parent 6b252a7018
commit b372c71fbf
5 changed files with 14 additions and 0 deletions

View File

@@ -42,6 +42,9 @@ public class JettyLauncher {
case "--max_file_size":
System.setProperty("gitbucket.maxFileSize", dim[1]);
break;
case "--upload_timeout":
System.setProperty("gitbucket.UploadTimeout", dim[1]);
break;
case "--gitbucket.home":
System.setProperty("gitbucket.home", dim[1]);
break;

View File

@@ -96,4 +96,10 @@ object FileUtil {
else
3 * 1024 * 1024
lazy val UploadTimeout =
if (System.getProperty("gitbucket.UploadTimeout") != null)
System.getProperty("gitbucket.UploadTimeout").toLong
else
3 * 10000
}

View File

@@ -66,6 +66,8 @@ $(function(){
@dropzone(clickable: Boolean, textareaId: Option[String]) = {
url: '@context.path/upload/file/@repository.owner/@repository.name',
maxFilesize: @{FileUtil.MaxFileSize / 1024 / 1024},
//timeout defaults to 30 secs
timeout: @{FileUtil.UploadTimeout},
clickable: @clickable,
previewTemplate: "<div class=\"dz-preview\">\n <div class=\"dz-progress\"><span class=\"dz-upload\" data-dz-uploadprogress>Uploading your files...</span></div>\n <div class=\"dz-error-message\"><span data-dz-errormessage></span></div>\n</div>",
success: function(file, id) {

View File

@@ -73,6 +73,8 @@ $(function(){
$("#drop").dropzone({
maxFilesize: @{gitbucket.core.util.FileUtil.MaxFileSize / 1024 / 1024},
url: '@context.path/upload/release/@repository.owner/@repository.name/@helpers.encodeRefName(tag.name)',
//timeout defaults to 30 secs
timeout: @{gitbucket.core.util.FileUtil.UploadTimeout},
previewTemplate: "<div class=\"dz-preview\">\n <div class=\"dz-progress\"><span class=\"dz-upload\" data-dz-uploadprogress>Uploading your files...</span></div>\n <div class=\"dz-error-message\"><span data-dz-errormessage></span></div>\n</div>",
success: function(file, id) {
var attach =