GithubHelp home page GithubHelp logo

Failed At is way out about sidekiq-failures HOT 6 CLOSED

mhfs avatar mhfs commented on September 28, 2024
Failed At is way out

from sidekiq-failures.

Comments (6)

mhfs avatar mhfs commented on September 28, 2024

Sounds feasible. Would you be willing to take a look on a possible solution? Do you see that happening to other dates in sidekiq like in the retries tab? Don't have the time to look into that for a few weeks but would be happy to merge a PR.

from sidekiq-failures.

 avatar commented on September 28, 2024

I'll try and have a look this weekend during RailsCamp AU.

from sidekiq-failures.

coolzilj avatar coolzilj commented on September 28, 2024

@Soliah Did you figure it out? I ran into the same issue.
I found a solution coolzilj/sidekiq-failures@498d297, but just can't understand why it solve this problem?

from sidekiq-failures.

coolzilj avatar coolzilj commented on September 28, 2024

@Soliah @mhfs
I think I understand why the hell this happening now.

My system time zone is 'CST' (China Standard Time)

Time.now.getutc.iso8601
=> "2013-09-27T05:28:49Z" (Correct!)

Time.parse(Time.now.strftime("%Y/%m/%d %H:%M:%S %Z")).getutc.iso8601
=> "2013-09-27T19:29:42Z" (This is what I got in sidekiq-failures, and IT IS WRONG!)


In Time::parse doc

Since there are numerous conflicts among locally defined time zone abbreviations all over the world, this method is not intended to understand all of them. For example, the abbreviation β€œCST” is used variously as:

-06:00 in America/Chicago,
-05:00 in America/Havana,
+08:00 in Asia/Harbin,
+09:30 in Australia/Darwin,
+10:30 in Australia/Adelaide,
etc.
Based on this fact, this method only understands the time zone abbreviations described in RFC 822 and the system time zone, in the order named. (i.e. a definition in RFC 822 overrides the system time zone definition.) The system time zone is taken from Time.local(year, 1, 1).zone and Time.local(year, 7, 1).zone. If the extracted time zone abbreviation does not match any of them, it is ignored and the given time is regarded as a local time.

In RFC 822 doc

zone = /  "CST" / "CDT"                ;  Central:  - 6/ - 5

CST means Central Standard Time (North America),
so Time.parse(Time.now.strftime("%Y/%m/%d %H:%M:%S %Z")).getutc.iso8601 this method would treat
'CST' (China Standard Time) as CST (Central Standard Time (North America)).
So what I got is totally wrong.

My solution is just use Time.parse(Time.now.strftime("%Y/%m/%d %H:%M:%S")).getutc.iso8601 ,
then Time::parse would use the local time.

refs:

from sidekiq-failures.

layerssss avatar layerssss commented on September 28, 2024

nice!

from sidekiq-failures.

mhfs avatar mhfs commented on September 28, 2024

I decided to keep everything UTC as Sidekiq seems to do. Thanks for the help.

from sidekiq-failures.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.