mirror of
https://github.com/haiwen/seafile.git
synced 2025-01-07 03:17:13 +08:00
Fix unlock file error and only record sync error (#2772)
* Fix unlock file error and only record sync error * Check folder perms and file locks immediately --------- Co-authored-by: yangheran <heran.yang@seafile.com>
This commit is contained in:
parent
d6d8954e87
commit
81a9e1cd57
@ -534,7 +534,7 @@ handle_file_lock (json_t *content)
|
||||
if (seaf_filelock_manager_get_lock_status (seaf->filelock_mgr, repo_id, path) == FILE_NOT_LOCKED) {
|
||||
return 0;
|
||||
}
|
||||
seaf_filelock_manager_mark_file_unlocked (seaf->filelock_mgr, repo_id, path);
|
||||
seaf_filelock_manager_unlock_file (seaf->filelock_mgr, repo_id, path);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -5321,8 +5321,8 @@ download_files_http (const char *repo_id,
|
||||
// Record a file-level sync error when failed to checkout file.
|
||||
if (rc == FETCH_CHECKOUT_FAILED) {
|
||||
if (checkout_file_failed) {
|
||||
send_file_sync_error_notification (repo_id, http_task->repo_name, de->name,
|
||||
SYNC_ERROR_ID_CHECKOUT_FILE);
|
||||
seaf_repo_manager_record_sync_error (repo_id, http_task->repo_name, de->name,
|
||||
SYNC_ERROR_ID_CHECKOUT_FILE);
|
||||
} else {
|
||||
checkout_file_failed = TRUE;
|
||||
send_file_sync_error_notification (repo_id, http_task->repo_name, de->name,
|
||||
|
@ -2178,6 +2178,12 @@ check_folder_permissions_one_server (SeafSyncManager *mgr,
|
||||
server_state->checking_folder_perms)
|
||||
return;
|
||||
|
||||
if (server_state->immediate_check_folder_perms) {
|
||||
server_state->immediate_check_folder_perms = FALSE;
|
||||
check_folder_permissions_one_server_immediately (mgr, host, server_state, repos, TRUE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (server_state->last_check_perms_time > 0 &&
|
||||
now - server_state->last_check_perms_time < CHECK_FOLDER_PERMS_INTERVAL)
|
||||
return;
|
||||
@ -2322,6 +2328,12 @@ check_locked_files_one_server (SeafSyncManager *mgr,
|
||||
server_state->checking_locked_files)
|
||||
return;
|
||||
|
||||
if (server_state->immediate_check_locked_files) {
|
||||
server_state->immediate_check_locked_files = FALSE;
|
||||
check_locked_files_one_server_immediately (mgr, host, server_state, repos, TRUE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (server_state->last_check_locked_files_time > 0 &&
|
||||
now - server_state->last_check_locked_files_time < CHECK_FOLDER_PERMS_INTERVAL)
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user