mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Call the tree walker for local system for now.
This commit is contained in:
parent
488b784dcf
commit
2a53561b2b
30
src/csync.c
30
src/csync.c
@ -24,6 +24,7 @@
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "c_lib.h"
|
||||
#include "csync_private.h"
|
||||
@ -190,9 +191,34 @@ out:
|
||||
}
|
||||
|
||||
int csync_update(CSYNC *ctx) {
|
||||
time_t start, finish;
|
||||
|
||||
if (ctx == NULL) {
|
||||
errno = EBADF;
|
||||
return -1;
|
||||
}
|
||||
|
||||
time(&start);
|
||||
ctx->replica = LOCAL_REPLICA;
|
||||
csync_ftw(ctx, ctx->local.uri, csync_walker, MAX_DEPTH);
|
||||
if (csync_ftw(ctx, ctx->local.uri, csync_walker, MAX_DEPTH) < 0) {
|
||||
return -1;
|
||||
}
|
||||
time(&finish);
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG,
|
||||
"Update detection for local replica took %.2f seconds",
|
||||
difftime(finish, start));
|
||||
|
||||
#if 0
|
||||
time(&start);
|
||||
ctx->replica = REMOTE_REPLICA;
|
||||
if (csync_ftw(ctx, ctx->remote.uri, csync_walker, MAX_DEPTH) < 0) {
|
||||
return -1;
|
||||
}
|
||||
time(&finish);
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG,
|
||||
"Update detection for remote replica took %.2f seconds",
|
||||
difftime(finish, start));
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -215,6 +241,8 @@ int csync_destroy(CSYNC *ctx) {
|
||||
csync_lock_remove(lock);
|
||||
}
|
||||
|
||||
/* TODO: destroy the rbtree */
|
||||
|
||||
csync_log_fini();
|
||||
|
||||
c_rbtree_free(ctx->local.tree);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user