mirror of
				https://github.com/GayPizzaSpecifications/foundation.git
				synced 2025-11-04 11:39:39 +00:00 
			
		
		
		
	Adjust cron expression and config comments.
This commit is contained in:
		@ -29,7 +29,9 @@ class BackupFeature : Feature() {
 | 
				
			|||||||
    registerCommandExecutor("fbackup", BackupCommand(plugin, backupPath, config, s3Client))
 | 
					    registerCommandExecutor("fbackup", BackupCommand(plugin, backupPath, config, s3Client))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (config.schedule.cron.isNotEmpty()) {
 | 
					    if (config.schedule.cron.isNotEmpty()) {
 | 
				
			||||||
      scheduleId = scheduler.cron("${config.schedule.cron} ?") {
 | 
					      // Assume user never wants to modify second. I'm not sure why this is enforced in Quartz.
 | 
				
			||||||
 | 
					      val expr = "0 ${config.schedule.cron}"
 | 
				
			||||||
 | 
					      scheduleId = scheduler.cron(expr) {
 | 
				
			||||||
        plugin.server.scheduler.runTask(plugin) { ->
 | 
					        plugin.server.scheduler.runTask(plugin) { ->
 | 
				
			||||||
          plugin.server.dispatchCommand(plugin.server.consoleSender, "fbackup")
 | 
					          plugin.server.dispatchCommand(plugin.server.consoleSender, "fbackup")
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
@ -1,8 +1,9 @@
 | 
				
			|||||||
# Configuration of backup scheduling, expressed by cron expressions.
 | 
					# Configuration of backup scheduling, expressed by cron expressions.
 | 
				
			||||||
schedule:
 | 
					schedule:
 | 
				
			||||||
  # Cron expression to use for the backup schedule.
 | 
					  # Cron expression to use for the backup schedule. This is not standard cron, but rather a subset
 | 
				
			||||||
 | 
					  # that is given to us by the Quartz Scheduler.
 | 
				
			||||||
  # Examples:
 | 
					  # Examples:
 | 
				
			||||||
  # "0 3 * * *"   -> every day at 3 AM
 | 
					  # "0 3 * * ?"   -> every day at 3 AM
 | 
				
			||||||
  # "0 3 * * SUN" -> every Sunday at 3 AM
 | 
					  # "0 3 * * SUN" -> every Sunday at 3 AM
 | 
				
			||||||
  cron: ""
 | 
					  cron: ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user