Skip to content

Commit ebc0de5

Browse files
committed
update uploadlastdelta
1 parent 3d05c4b commit ebc0de5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/main/java/com/uid2/optout/Main.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,9 @@ public void run(String[] args) throws IOException {
293293
futs.add(this.deploySingleInstance(logProducer));
294294

295295
// upload last delta produced and potentially not uploaded yet
296-
futs.add((this.uploadLastDelta(uploadCs, logProducer, uploadVerticle.eventUpload(), uploadVerticle.eventRefresh())));
296+
// always use main cs/cloudSyncVerticle for refresh mechanism (legacy verticle is upload-only)
297+
// uploadCs is used only for determining the cloud path (legacy folder vs main folder)
298+
futs.add((this.uploadLastDelta(cs, uploadCs, logProducer, cloudSyncVerticle.eventRefresh())));
297299
}
298300

299301
// deploy sqs producer if enabled
@@ -364,7 +366,8 @@ public void run(String[] args) throws IOException {
364366
});
365367
}
366368

367-
private Future uploadLastDelta(OptOutCloudSync cs, OptOutLogProducer logProducer, String eventUpload, String eventRefresh) {
369+
370+
private Future uploadLastDelta(OptOutCloudSync cs, OptOutCloudSync uploadCs, OptOutLogProducer logProducer, String eventRefresh) {
368371
final String deltaLocalPath;
369372
try {
370373
deltaLocalPath = logProducer.getLastDelta();
@@ -383,7 +386,8 @@ private Future uploadLastDelta(OptOutCloudSync cs, OptOutLogProducer logProducer
383386
handler.set(cs.registerNewCloudPathsHandler(cloudPaths -> {
384387
try {
385388
cs.unregisterNewCloudPathsHandler(handler.get());
386-
final String deltaCloudPath = cs.toCloudPath(deltaLocalPath);
389+
// use uploadCs for cloud path (may be different folder than cs)
390+
final String deltaCloudPath = uploadCs.toCloudPath(deltaLocalPath);
387391
if (cloudPaths.contains(deltaCloudPath)) {
388392
// if delta is already uploaded, the work is already done
389393
LOGGER.info("found no last delta that needs to be uploaded");

0 commit comments

Comments
 (0)