Skip to content

Update time.py to solve the microsecond issues#5199

Merged
auvipy merged 2 commits into
celery:masterfrom
ckdanny:master
May 18, 2020
Merged

Update time.py to solve the microsecond issues#5199
auvipy merged 2 commits into
celery:masterfrom
ckdanny:master

Conversation

@ckdanny

@ckdanny ckdanny commented Nov 27, 2018

Copy link
Copy Markdown
Contributor

When relative is set to True, the day, hour, minutes second will be round to the nearest one, however, the original program do not update the microsecond (reset it). As a result, the run-time offset on the microsecond will then be accumulated.
For example, given the interval is 15s and relative is set to True

  1. 2018-11-27T15:01:30.123236+08:00
  2. 2018-11-27T15:01:45.372687+08:00
  3. 2018-11-27T15:02:00.712601+08:00
  4. 2018-11-27T15:02:15.987720+08:00
  5. 2018-11-27T15:02:31.023670+08:00
    When relative is set to True, microsecond offset still accumulate #5198

Danny Chan added 2 commits November 27, 2018 16:02
When `relative` is set to True, the day, hour, minutes second will be round to the nearest one, however, the original program do not update the microsecond (reset it). As a result, the run-time offset on the microsecond will then be accumulated. 
For example, given the interval is 15s and relative is set to True
1.    2018-11-27T15:01:30.123236+08:00
2.    2018-11-27T15:01:45.372687+08:00
3.    2018-11-27T15:02:00.712601+08:00
4.    2018-11-27T15:02:15.987720+08:00
5.    2018-11-27T15:02:31.023670+08:00
Update time.py to solve the microsecond issues

@auvipy auvipy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add some test for this change?

@auvipy auvipy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please rebase it once on top of the master?

@auvipy auvipy added this to the 4.4.0 milestone May 6, 2019
@auvipy auvipy self-assigned this May 7, 2019
@auvipy auvipy modified the milestones: 4.4.0, 4.5 Jun 14, 2019
@auvipy auvipy closed this Dec 16, 2019
@auvipy auvipy reopened this Dec 16, 2019
@codecov

codecov Bot commented Dec 16, 2019

Copy link
Copy Markdown

Codecov Report

Merging #5199 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #5199   +/-   ##
=======================================
  Coverage   82.92%   82.92%           
=======================================
  Files         142      142           
  Lines       16165    16165           
  Branches     2019     2019           
=======================================
  Hits        13405    13405           
  Misses       2563     2563           
  Partials      197      197
Impacted Files Coverage Δ
celery/utils/time.py 64.76% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d2d0df3...55e1de5. Read the comment docs.

@auvipy auvipy modified the milestones: 4.5, 4.4.x Dec 16, 2019
@auvipy auvipy closed this May 18, 2020
@auvipy auvipy reopened this May 18, 2020
@lgtm-com

lgtm-com Bot commented May 18, 2020

Copy link
Copy Markdown

This pull request fixes 5 alerts when merging 55e1de5 into fae3336 - view on LGTM.com

fixed alerts:

  • 4 for Module is imported with 'import' and 'import from'
  • 1 for Non-exception in 'except' clause