Skip to content

Commit 1d95d52

Browse files
author
virco
committed
stop path resolution once we get a folderid without pending tasks as we know that we will not find any inside
1 parent d944ded commit 1d95d52

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

plocalscan.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ typedef struct {
6363
char name[1];
6464
} sync_folderlist;
6565

66-
typedef sync_folderlist sync_folderlist_tuple[2];
67-
6866
static pthread_mutex_t scan_mutex=PTHREAD_MUTEX_INITIALIZER;
6967
static pthread_cond_t scan_cond=PTHREAD_COND_INITIALIZER;
7068
static uint32_t scan_wakes=0;

ppathstatus.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,8 @@ static psync_path_status_t psync_path_status_drive(const char *path, size_t path
499499
}
500500
wrlocked=0;
501501
psync_sql_rdlock();
502+
if (!get_folder_tasks(0, 0))
503+
return rdunlock_return(PSYNC_PATH_STATUS_IN_SYNC);
502504
if (!path_len)
503505
return psync_path_status_drive_folder_locked(0);
504506
restart:
@@ -539,6 +541,8 @@ static psync_path_status_t psync_path_status_drive(const char *path, size_t path
539541
flags=ce->flags;
540542
found=1;
541543
poff=off+1;
544+
if (!get_folder_tasks(folderid, 0))
545+
return rdunlock_return(PSYNC_PATH_STATUS_IN_SYNC);
542546
break;
543547
}
544548
if (found)
@@ -581,6 +585,8 @@ static psync_path_status_t psync_path_status_drive(const char *path, size_t path
581585
ce->itemid=folderid;
582586
ce->flags=flags;
583587
poff=off+1;
588+
if (!get_folder_tasks(folderid, 0))
589+
return rdunlock_return(PSYNC_PATH_STATUS_IN_SYNC);
584590
}
585591
}
586592
if (poff==path_len)

0 commit comments

Comments
 (0)