Skip to content

Commit

Permalink
refactor: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Angular2Guy committed Oct 7, 2023
1 parent 73fb0aa commit e4da2b4
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
@Component
public class CronJobs {
private static final Logger LOG = LoggerFactory.getLogger(CronJobs.class);
private static volatile boolean MIGRATIONS_DONE = false;
private static volatile boolean migrationsDone = false;
private final ActorService actorService;
private final MovieService movieService;
private final UserDetailService userService;
Expand All @@ -50,13 +50,13 @@ public CronJobs(ActorService actorService, MovieService movieService, UserDetail
@SchedulerLock(name = "Migrations_scheduledTask", lockAtLeastFor = "PT2H", lockAtMostFor = "PT3H")
public void startMigrations() {
LOG.info("Start migrations.");
if (!MIGRATIONS_DONE) {
if (!migrationsDone) {
this.dataMigrationService.encryptUserKeys().thenApplyAsync(result -> {
LOG.info("Users migrated: {}", result);
return result;
});
}
MIGRATIONS_DONE = true;
migrationsDone = true;
}

@Scheduled(cron = "5 0 1 * * ?")
Expand Down

0 comments on commit e4da2b4

Please sign in to comment.