que-scheduler 4.0.1 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +9 -0
- data/lib/que/scheduler/migrations.rb +5 -0
- data/lib/que/scheduler/version.rb +1 -1
- metadata +1 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 198960bfd5797bdc85e0b320170350bb3a752e5c4ed90db31b86cf040b5dbd92
         | 
| 4 | 
            +
              data.tar.gz: 3f7128c8d159d5007ae42e72eca65059fd5e3f7cc9d60706dd72d7ea5002e686
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: db16c38be02a29d413687a3faaffd7749a88ca141bfcee724b0f1c410ddb4094ca6b92c73c878250d088cbaec5242dd8b755d3d3bf44dacd80dd921b710eb9bd
         | 
| 7 | 
            +
              data.tar.gz: fd46b785a759e3435491e54015d7ffff61bcf8ad5b0bd782a505838c148e9c778d6c994aaad71697cbe815bd47dffa22dcc3e35de8dc312eebbcc85a2752e26a
         | 
    
        data/README.md
    CHANGED
    
    | @@ -220,6 +220,15 @@ The changes in past migrations were: | |
| 220 220 | 
             
            |    5    | Dropped an unnecessary index                                                    |
         | 
| 221 221 | 
             
            |    6    | Enforced single scheduler job at the trigger level                              |
         | 
| 222 222 |  | 
| 223 | 
            +
            The changes to the DB ([DDL](https://en.wikipedia.org/wiki/Data_definition_language)) are all 
         | 
| 224 | 
            +
            captured in the structure.sql so will be re-run in correctly if squashed - except for the actual 
         | 
| 225 | 
            +
            scheduling of the job itself (as that is [DML](https://en.wikipedia.org/wiki/Data_manipulation_language)).
         | 
| 226 | 
            +
            If you squash your migrations make sure this is added as the final line:
         | 
| 227 | 
            +
             | 
| 228 | 
            +
            ```ruby
         | 
| 229 | 
            +
            Que::Scheduler::Migrations.reenqueue_scheduler_if_missing
         | 
| 230 | 
            +
            ```
         | 
| 231 | 
            +
             | 
| 223 232 | 
             
            ## HA Redundancy and DB restores
         | 
| 224 233 |  | 
| 225 234 | 
             
            Because of the way que-scheduler works, it requires no additional processes. It is, itself, a Que job.
         | 
| @@ -41,6 +41,11 @@ module Que | |
| 41 41 | 
             
                      result.any?
         | 
| 42 42 | 
             
                    end
         | 
| 43 43 |  | 
| 44 | 
            +
                    # This method is only intended for use in squashed migrations
         | 
| 45 | 
            +
                    def reenqueue_scheduler_if_missing
         | 
| 46 | 
            +
                      Que::Scheduler::SchedulerJob.enqueue if Que::Scheduler::Db.count_schedulers.zero?
         | 
| 47 | 
            +
                    end
         | 
| 48 | 
            +
             | 
| 44 49 | 
             
                    private
         | 
| 45 50 |  | 
| 46 51 | 
             
                    def migrate_up(current, version)
         |