Bugfix: 修复SqlSessionService在sqlite下因时区设置不对导致频繁warn#73
Merged
Conversation
Contributor
weimch
commented
Jun 1, 2026
- 问题:当前在SqlSessionService的实现中,默认创建DB的表中,update_time使用了sqlalchemy的func.now,但在更新时间时,使用了datetime.now,在sqlite实现里,func.now默认使用了utc的时间,而datetime.now不是utc的时间,导致append_event时,因时区不同,导致diff失败,warn告警
- 解决方案:总是使用func.now来更新时间
- 问题:当前在SqlSessionService的实现中,默认创建DB的表中,update_time使用了sqlalchemy的func.now,但在更新时间时,使用了datetime.now,在sqlite实现里,func.now默认使用了utc的时间,而datetime.now不是utc的时间,导致append_event时,因时区不同,导致diff失败,warn告警 - 解决方案:总是使用func.now来更新时间
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #73 +/- ##
==========================================
Coverage ? 87.32279%
==========================================
Files ? 413
Lines ? 40135
Branches ? 0
==========================================
Hits ? 35047
Misses ? 5088
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
raychen911
approved these changes
Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.