owncloudcmd: restart the sync if required

Fixes #2038
This commit is contained in:
Olivier Goffart 2014-09-12 17:22:02 +02:00
Родитель ada1d42ebf
Коммит a4dbf5942c
2 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -176,8 +176,6 @@ system("sqlite3 " . localDir().'.csync_journal.db .dump');
#new directory should be uploaded
system("mv " . localDir().'readonlyDirectory_PERM_M_/subdir_PERM_CK_ ' . localDir().'normalDirectory_PERM_CKDNV_/subdir_PERM_CKDNV_' );
# two syncs may be necessary for now: https://github.com/owncloud/mirall/issues/2038
csync();
csync();
system("sqlite3 " . localDir().'.csync_journal.db .dump');
assertCsyncJournalOk(localDir());
@ -209,8 +207,6 @@ system("mv " . localDir().'readonlyDirectory_PERM_M_/subdir_PERM_CK_ ' . localDi
#2. move a directory from read to read only (move the directory from previous step)
system("mv " . localDir().'normalDirectory_PERM_CKDNV_/subdir_PERM_CKDNV_ ' . localDir().'readonlyDirectory_PERM_M_/moved_PERM_CK_' );
# two syncs may be necessary for now: https://github.com/owncloud/mirall/issues/2038
csync();
csync();
assertCsyncJournalOk(localDir());

Просмотреть файл

@ -161,6 +161,8 @@ int main(int argc, char **argv) {
account.setSslErrorHandler(sslErrorHandler);
AccountManager::instance()->setAccount(&account);
restart_sync:
CSYNC *_csync_ctx;
if( csync_create( &_csync_ctx, options.source_dir.toUtf8(),
options.target_url.toUtf8()) < 0 ) {
@ -238,6 +240,11 @@ int main(int argc, char **argv) {
ne_sock_exit();
if (engine.isAnotherSyncNeeded()) {
qDebug() << "Restarting Sync, because another sync is needed";
goto restart_sync;
}
return 0;
}