[Backgroundrb-devel] UK Daylight Savings

Zachary Powell zach at plugthegap.co.uk
Mon Mar 31 08:56:51 EDT 2008


thanks Thomas,

Mm, I think my first patch was making it fire repeatedly because the time it
created was in the past. I've improved it (move forwards not back), but
obviously its still a hack around the issue. not even sure if they're firing
at the right time (but as they're early morning maintenance scripts 1 hour
off is no big deal):
    server/cron_trigger.rb#160:

      begin
        s = "#{sec}, #{min}, #{hour}, #{day}, #{month}, #{year}, #{wday},
#{yday}, #{isdst}, #{zone}"
        if(day == 32)
          day = 1
          month += 1
          if(month == 13)
            month = 1
            year +=1
          end
        end
        s2 = "#{sec}, #{min}, #{hour}, #{day}, #{month}, #{year}, #{wday},
#{yday}, #{isdst}, #{zone}"
        puts "changed\n#{s}\n#{s2}" unless s == s2
        Time.local sec, min, hour, day, month, year, wday, yday, isdst, zone
      rescue => e
        raise "failed\n#{s}\n\#{s2}"
      end

which produced this in the log:

changed
0, 0, 0, 32, 3, 2008, 1, 91, true, BST
0, 0, 0, 1, 4, 2008, 1, 91, true, BST
changed
30, 0, 0, 32, 3, 2008, 1, 91, true, BST
30, 0, 0, 1, 4, 2008, 1, 91, true, BST
changed
0, 10, 5, 32, 3, 2008, 1, 91, true, BST
0, 10, 5, 1, 4, 2008, 1, 91, true, BST
changed
0, 20, 5, 32, 3, 2008, 1, 91, true, BST
0, 20, 5, 1, 4, 2008, 1, 91, true, BST
changed
30, 20, 0, 32, 3, 2008, 1, 91, true, BST
30, 20, 0, 1, 4, 2008, 1, 91, true, BST
changed
0, 0, 0, 32, 3, 2008, 1, 91, true, BST
0, 0, 0, 1, 4, 2008, 1, 91, true, BST
changed
0, 50, 2, 32, 3, 2008, 1, 91, true, BST
0, 50, 2, 1, 4, 2008, 1, 91, true, BST


unfortunately i've got too much going on to look into a proper fix, but i'll
post one in a few weeks once the busy period has blown over (hopefully this
will hold out, seems logical..)


On Mon, Mar 31, 2008 at 5:56 AM, Thomas R. Koll <tomk32 at gmx.de> wrote:

>
> Am 31.03.2008 um 05:21 schrieb Zachary Powell:
> > A quick fix for anyone running into this problem:
> >
> > load_schedule was crashing cron_trigger.rb#160, and I found that
> > for triggers like "0 20 5 * * * *" it was putting in 32 for the
> > date (even though its Mon Mar 31 04:16:21 BST 2008). Something to
> > do with switching to day light savings I think, which concludes
> > after 2am. I patched it by adding
> >
> > day = 31 if day == 32
>
> I guess this version would be better for now (until some madman
> changes the whole world, uhh don't read my sig)
>
> day = 31 if day > 31
>
> ciao, tom
>
> --
> Thomas R. "TomK32" Koll || http://tomk32.de || http://ananasblau.com
> (NEW)
> just a geek trying to change the world
> Skype: TomK32 || Mail: tomk32 at gmx.de
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20080331/51a19874/attachment.html 


More information about the Backgroundrb-devel mailing list