diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/NotebookRepoSync.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/NotebookRepoSync.java index f67b71f5d6c..e7cb6a3fafb 100644 --- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/NotebookRepoSync.java +++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/NotebookRepoSync.java @@ -183,7 +183,8 @@ void sync(int sourceRepoIndex, int destRepoIndex, AuthenticationInfo subject) th List srcNotes = srcRepo.list(subject); List dstNotes = dstRepo.list(subject); - Map> noteIDs = notesCheckDiff(srcNotes, srcRepo, dstNotes, dstRepo); + Map> noteIDs = notesCheckDiff(srcNotes, srcRepo, dstNotes, dstRepo, + subject); List pushNoteIDs = noteIDs.get(pushKey); List pullNoteIDs = noteIDs.get(pullKey); List delDstNoteIDs = noteIDs.get(delDstKey); @@ -256,7 +257,8 @@ NotebookRepo getRepo(int repoIndex) throws IOException { } private Map> notesCheckDiff(List sourceNotes, - NotebookRepo sourceRepo, List destNotes, NotebookRepo destRepo) + NotebookRepo sourceRepo, List destNotes, NotebookRepo destRepo, + AuthenticationInfo subject) throws IOException { List pushIDs = new ArrayList(); List pullIDs = new ArrayList(); @@ -268,8 +270,8 @@ private Map> notesCheckDiff(List sourceNotes, dnote = containsID(destNotes, snote.getId()); if (dnote != null) { /* note exists in source and destination storage systems */ - sdate = lastModificationDate(sourceRepo.get(snote.getId(), null)); - ddate = lastModificationDate(destRepo.get(dnote.getId(), null)); + sdate = lastModificationDate(sourceRepo.get(snote.getId(), subject)); + ddate = lastModificationDate(destRepo.get(dnote.getId(), subject)); if (sdate.compareTo(ddate) != 0) { if (sdate.after(ddate) || oneWaySync) {