Skip to content

Commit

Permalink
Merge pull request #1111 from meganz/sync-logs
Browse files Browse the repository at this point in the history
New sync logs to debug the initial scan
  • Loading branch information
javiserrano authored Jul 2, 2018
2 parents 63e1c32 + 173bc28 commit 962ddd4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/megaclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3096,7 +3096,8 @@ bool MegaClient::dispatch(direction_t d)
{
if (ts->fa->mtime != nexttransfer->mtime || ts->fa->size != nexttransfer->size)
{
LOG_warn << "Modification detected starting upload";
LOG_warn << "Modification detected starting upload. Size: " << nexttransfer->size << " Mtime: " << nexttransfer->mtime
<< " FaSize: " << ts->fa->size << " FaMtime: " << ts->fa->mtime;
nexttransfer->failed(API_EREAD);
continue;
}
Expand Down Expand Up @@ -10644,6 +10645,7 @@ error MegaClient::addsync(string* rootpath, const char* debris, string* localdeb
syncsup = false;
e = API_OK;
sync->initializing = false;
LOG_debug << "Initial scan finished. New / modified files: " << sync->dirnotify->notifyq[DirNotify::DIREVENTS].size();
}
else
{
Expand Down
10 changes: 10 additions & 0 deletions src/sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ LocalNode* Sync::checkpath(LocalNode* l, string* localpath, string* localname, d
// if it's a file, size and mtime must match to qualify
if (l->type != FILENODE || (l->size == fa->size && l->mtime == fa->mtime))
{
LOG_verbose << "Cached localnode is still valid. Type: " << l->type << " Size: " << l->size << " Mtime: " << l->mtime;
l->scanseqno = scanseqno;

if (l->type == FOLDERNODE)
Expand All @@ -654,6 +655,15 @@ LocalNode* Sync::checkpath(LocalNode* l, string* localpath, string* localname, d

if (initializing)
{
if (cl)
{
LOG_verbose << "Outdated localnode. Type: " << cl->type << " Size: " << cl->size << " Mtime: " << cl->mtime
<< " FaType: " << fa->type << " FaSize: " << fa->size << " FaMtime: " << fa->mtime;
}
else
{
LOG_verbose << "New file. FaType: " << fa->type << " FaSize: " << fa->size << " FaMtime: " << fa->mtime;
}
delete fa;
return NULL;
}
Expand Down
3 changes: 2 additions & 1 deletion src/transfer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,8 @@ void Transfer::failed(error e, dstime timeleft)

if (slot && slot->fa && (slot->fa->mtime != mtime || slot->fa->size != size))
{
LOG_warn << "Modification detected during active upload";
LOG_warn << "Modification detected during active upload. Size: " << size << " Mtime: " << mtime
<< " FaSize: " << slot->fa->size << " FaMtime: " << slot->fa->mtime;
defer = false;
}
}
Expand Down

0 comments on commit 962ddd4

Please sign in to comment.