Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backend: Use UTC for instance stats default time #664

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

pothos
Copy link
Member

@pothos pothos commented Aug 2, 2023

The time.Now() function uses the local time which causes a mismatch and no entries get created when, e.g., being two hours ahead because the instance would be checking in at 10 UTC but it gets compared to 12 local time and in this time span nothing is able to check in because the local time will always be too far ahead.
Use the right time zone for the default time of the instance stats query.

How to use

Testing done

Checked whether entries get created:

psql postgres://postgres:nebraska@localhost:5432/nebraska -c "select * from instance_stats;"

The time.Now() function uses the local time which causes a mismatch
and no entries get created when, e.g., being two hours ahead because
the instance would be checking in at 10 UTC but it gets compared to
12 local time and in this time span nothing is able to check in because
the local time will always be too far ahead.
Use the right time zone for the default time of the instance stats
query.
@skoeva skoeva merged commit 4c0c54d into main Aug 2, 2023
2 checks passed
@pothos pothos deleted the kai/instance-stats-default-time branch August 2, 2023 16:06
@yolossn yolossn mentioned this pull request Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants