mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-09-14 06:12:50 +00:00
Ignore 'need_idx_progress' parameter when handling upload requests.
There is a bug in cloud file browser that can cause high number of concurrent uploads. Also reduce the number retries when updating head commit in db.
This commit is contained in:
@@ -892,7 +892,7 @@ fast_forward_or_merge (const char *repo_id,
|
||||
SeafCommit *base,
|
||||
SeafCommit *new_commit)
|
||||
{
|
||||
#define MAX_RETRY_COUNT 10
|
||||
#define MAX_RETRY_COUNT 3
|
||||
|
||||
SeafRepo *repo = NULL;
|
||||
SeafCommit *current_head = NULL, *merged_commit = NULL;
|
||||
|
@@ -453,7 +453,7 @@ gen_new_commit (const char *repo_id,
|
||||
char *new_commit_id,
|
||||
GError **error)
|
||||
{
|
||||
#define MAX_RETRY_COUNT 10
|
||||
#define MAX_RETRY_COUNT 3
|
||||
|
||||
SeafRepo *repo = NULL;
|
||||
SeafCommit *new_commit = NULL, *current_head = NULL, *merged_commit = NULL;
|
||||
@@ -585,8 +585,7 @@ retry:
|
||||
|
||||
goto retry;
|
||||
} else {
|
||||
seaf_warning ("Too many retries for concurrent update on repo %s. Stop retrying.\n",
|
||||
repo_id);
|
||||
seaf_warning ("Stop updating repo %s after %d retries.\n", repo_id, MAX_RETRY_COUNT);
|
||||
g_set_error (error, SEAFILE_DOMAIN, SEAF_ERR_GENERAL, "Concurrent update");
|
||||
ret = -1;
|
||||
goto out;
|
||||
|
@@ -2340,9 +2340,10 @@ upload_headers_cb (evhtp_request_t *req, evhtp_headers_t *hdr, void *arg)
|
||||
fsm->line = evbuffer_new ();
|
||||
fsm->form_kvs = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
g_free, g_free);
|
||||
const char *need_idx_progress = evhtp_kv_find (req->uri->query, "need_idx_progress");
|
||||
if (g_strcmp0(need_idx_progress, "true") == 0)
|
||||
fsm->need_idx_progress = TRUE;
|
||||
/* const char *need_idx_progress = evhtp_kv_find (req->uri->query, "need_idx_progress"); */
|
||||
/* if (g_strcmp0(need_idx_progress, "true") == 0) */
|
||||
/* fsm->need_idx_progress = TRUE; */
|
||||
fsm->need_idx_progress = FALSE;
|
||||
|
||||
if (progress_id != NULL) {
|
||||
progress = g_new0 (Progress, 1);
|
||||
|
Reference in New Issue
Block a user