Skip to content

Commit

Permalink
EXT-323 Automatic snapshots app
Browse files Browse the repository at this point in the history
Fixed weekly cron-expression
  • Loading branch information
Runar Myklebust committed Feb 14, 2017
1 parent 11e85f4 commit 7f7bb0e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ projectName = snapshotter
appName = com.enonic.app.snapshotter
displayName = Snapshotter
xpVersion = 6.9.1
version = 1.0.2
version = 1.0.3
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ public void schedule( final Job job )
final Duration executionTime = job.nextExecutionTime();
LOG.debug( "Scheduling job: " + job.description() + " in " + executionTime.toString() );
final JobTask task = new JobTask( job.executor(), job, this );
this.timer.schedule( task, executionTime.toMillis() );
try
{
this.timer.schedule( task, executionTime.toMillis() );
}
catch ( final IllegalStateException e )
{
LOG.error( "Timer in invalid state, restart application to restore state" );
}
}

@Override
Expand Down
3 changes: 0 additions & 3 deletions src/main/resources/admin/tools/snapshotter/snapshotter.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ exports.get = function (req) {
var result = snapshotter.schedules();

result.schedules.forEach(function (schedule) {

var date = new Date(Date.parse(schedule.nextExecTime));

schedule.readable = date.toLocaleDateString() + " " + date.toLocaleTimeString();

});

var model = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ snapshot.daily.cron=0 1 * * *
snapshot.daily.keep=P7D
snapshot.daily.enabled=true

snapshot.weekly.cron=* 4 * * 1
snapshot.weekly.cron=0 4 * * 1
snapshot.weekly.keep=P30D
snapshot.weekly.enabled=true

Expand Down

0 comments on commit 7f7bb0e

Please sign in to comment.