Skip to content

Commit 6ce5e5a

Browse files
authored
Merge pull request #213 from haiwen/cross_repo_copy
Optimize copy and move file.
2 parents 8367640 + cb3f313 commit 6ce5e5a

File tree

4 files changed

+304
-219
lines changed

4 files changed

+304
-219
lines changed

server/copy-mgr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ seaf_copy_manager_get_task (SeafCopyManager *mgr,
7878
"canceled", task->canceled, "failed", task->failed,
7979
"successful", task->successful,
8080
NULL);
81+
if (task->canceled || task->failed || task->successful)
82+
g_hash_table_remove(priv->copy_tasks, task_id);
8183
}
8284

8385
pthread_mutex_unlock (&priv->lock);
@@ -135,7 +137,6 @@ seaf_copy_manager_add_task (SeafCopyManager *mgr,
135137
const char *dst_filename,
136138
int replace,
137139
const char *modifier,
138-
gint64 total_files,
139140
CopyTaskFunc function,
140141
gboolean need_progress)
141142
{
@@ -148,7 +149,6 @@ seaf_copy_manager_add_task (SeafCopyManager *mgr,
148149
task_id = gen_uuid();
149150
task = g_new0 (CopyTask, 1);
150151
memcpy (task->task_id, task_id, 36);
151-
task->total = total_files;
152152

153153
pthread_mutex_lock (&priv->lock);
154154
g_hash_table_insert (priv->copy_tasks, g_strdup(task_id), task);

server/copy-mgr.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ seaf_copy_manager_add_task (SeafCopyManager *mgr,
4747
const char *dst_filename,
4848
int replace,
4949
const char *modifier,
50-
gint64 total_files,
5150
CopyTaskFunc function,
5251
gboolean need_progress);
5352

0 commit comments

Comments
 (0)