Skip to content

Commit

Permalink
The 'source up-to-dateness' metric could report a negative number of …
Browse files Browse the repository at this point in the history
…days ago due to differences in timezone or system clock between Quality-time and the source. Fixes #1217.
  • Loading branch information
fniessink committed Jun 10, 2020
1 parent 55d2dca commit 3719a80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/collector/src/collector_utilities/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def sha1_hash(string: str) -> str:

def days_ago(date_time: datetime) -> int:
"""Return the days since the date/time."""
return (datetime.now(tz=date_time.tzinfo) - date_time).days
return max(0, (datetime.now(tz=date_time.tzinfo) - date_time).days)


def is_regexp(string: str) -> bool:
Expand Down
3 changes: 2 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Fixed

- Reenable environment variables to set a proxy to be used by the collector. See https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support. Fixes [#1217](https://github.com/ICTU/quality-time/issues/1217).
- The 'source up-to-dateness' metric could report a negative number of days ago due to differences in timezone or system clock between Quality-time and the source. Fixes [#1217](https://github.com/ICTU/quality-time/issues/1213).
- Reenable environment variables to set a proxy to be used by the collector. See the [deployment documentation](DEPLOY.md). Fixes [#1217](https://github.com/ICTU/quality-time/issues/1217).

## [2.3.1] - [2020-06-02]

Expand Down

0 comments on commit 3719a80

Please sign in to comment.