Parcourir la source

Reverse schedule order

Andrew Kane il y a 9 ans
Parent
commit
70d8eea289
2 fichiers modifiés avec 9 ajouts et 6 suppressions
  1. 8 5
      README.md
  2. 1 1
      lib/blazer.rb

+ 8 - 5
README.md

@@ -65,20 +65,20 @@ Be sure to set a host in `config/environments/production.rb` for emails to work.
 config.action_mailer.default_url_options = {host: "blazerme.herokuapp.com"}
 ```
 
-Schedule checks to run (with cron, [Heroku Scheduler](https://elements.heroku.com/addons/scheduler), etc). The default options are every 1 day, 1 hour, or 5 minutes, which you can customize. For each of these options, set up a task to run.
+Schedule checks to run (with cron, [Heroku Scheduler](https://elements.heroku.com/addons/scheduler), etc). The default options are every 5 minutes, 1 hour, or 1 day, which you can customize. For each of these options, set up a task to run.
 
 ```sh
-rake blazer:run_checks SCHEDULE="1 day"
-rake blazer:run_checks SCHEDULE="1 hour"
 rake blazer:run_checks SCHEDULE="5 minutes"
+rake blazer:run_checks SCHEDULE="1 hour"
+rake blazer:run_checks SCHEDULE="1 day"
 ```
 
 Here’s what it looks like with cron.
 
 ```
-0   0 * * * * user rake blazer:run_checks SCHEDULE="1 day"
-0   * * * * * user rake blazer:run_checks SCHEDULE="1 hour"
 */5 * * * * * user rake blazer:run_checks SCHEDULE="5 minutes"
+0   * * * * * user rake blazer:run_checks SCHEDULE="1 hour"
+0   0 * * * * user rake blazer:run_checks SCHEDULE="1 day"
 ```
 
 You can also set up failing checks to be sent once a day (or whatever you prefer).
@@ -336,6 +336,9 @@ add_column :blazer_checks, :creator_id, :integer
 add_column :blazer_checks, :invert, :boolean
 add_column :blazer_checks, :schedule, :string
 add_column :blazer_checks, :last_run_at, :timestamp
+commit_db_transaction
+
+Blazer::Check.update_all schedule: "1 hour"
 ```
 
 ### 1.0

+ 1 - 1
lib/blazer.rb

@@ -22,7 +22,7 @@ module Blazer
   end
   self.audit = true
   self.user_name = :name
-  self.check_schedules = ["1 day", "1 hour", "5 minutes"]
+  self.check_schedules = ["5 minutes", "1 hour", "1 day"]
 
   TIMEOUT_MESSAGE = "Query timed out :("
   TIMEOUT_ERRORS = [