Skip to content

Commit 1f2dcd3

Browse files
pass subject to get method in sync
1 parent c717daf commit 1f2dcd3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/NotebookRepoSync.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ void sync(int sourceRepoIndex, int destRepoIndex, AuthenticationInfo subject) th
183183
List <NoteInfo> srcNotes = srcRepo.list(subject);
184184
List <NoteInfo> dstNotes = dstRepo.list(subject);
185185

186-
Map<String, List<String>> noteIDs = notesCheckDiff(srcNotes, srcRepo, dstNotes, dstRepo);
186+
Map<String, List<String>> noteIDs = notesCheckDiff(srcNotes, srcRepo, dstNotes, dstRepo,
187+
subject);
187188
List<String> pushNoteIDs = noteIDs.get(pushKey);
188189
List<String> pullNoteIDs = noteIDs.get(pullKey);
189190
List<String> delDstNoteIDs = noteIDs.get(delDstKey);
@@ -256,7 +257,8 @@ NotebookRepo getRepo(int repoIndex) throws IOException {
256257
}
257258

258259
private Map<String, List<String>> notesCheckDiff(List<NoteInfo> sourceNotes,
259-
NotebookRepo sourceRepo, List<NoteInfo> destNotes, NotebookRepo destRepo)
260+
NotebookRepo sourceRepo, List<NoteInfo> destNotes, NotebookRepo destRepo,
261+
AuthenticationInfo subject)
260262
throws IOException {
261263
List <String> pushIDs = new ArrayList<String>();
262264
List <String> pullIDs = new ArrayList<String>();
@@ -268,8 +270,8 @@ private Map<String, List<String>> notesCheckDiff(List<NoteInfo> sourceNotes,
268270
dnote = containsID(destNotes, snote.getId());
269271
if (dnote != null) {
270272
/* note exists in source and destination storage systems */
271-
sdate = lastModificationDate(sourceRepo.get(snote.getId(), null));
272-
ddate = lastModificationDate(destRepo.get(dnote.getId(), null));
273+
sdate = lastModificationDate(sourceRepo.get(snote.getId(), subject));
274+
ddate = lastModificationDate(destRepo.get(dnote.getId(), subject));
273275

274276
if (sdate.compareTo(ddate) != 0) {
275277
if (sdate.after(ddate) || oneWaySync) {

0 commit comments

Comments
 (0)