Skip to content

Commit 2bc51e8

Browse files
committed
Update changelog and added a note for comparing dates by string
1 parent 54f7b1c commit 2bc51e8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ however, insignificant breaking changes do not guarantee a major version bump, s
2323
- `REGISTRY_PLUGINS_ONLY`, environment variable, when set, restricts to only allow adding registry plugins. ([PR #3247](https://github.com/modmail-dev/modmail/pull/3247))
2424
- `DISCORD_LOG_LEVEL` environment variable to set the log level of discord.py. ([PR #3216](https://github.com/modmail-dev/Modmail/pull/3216))
2525
- New registry plugin: [`autoreact`](https://github.com/martinbndr/kyb3r-modmail-plugins/tree/master/autoreact).
26-
- `STREAM_LOG_FORMAT` and `FILE_LOG_FORMAT` for settings the log format of the stream and file handlers respectively. Possible options are `json` and `plain` (default). ([PR #3305](https://github.com/modmail-dev/Modmail/pull/3305))
26+
- `STREAM_LOG_FORMAT` and `FILE_LOG_FORMAT` environment variable to set the log format of the stream and file handlers respectively. Possible options are `json` and `plain` (default). ([PR #3305](https://github.com/modmail-dev/Modmail/pull/3305))
27+
- `LOG_EXPIRATION` environment variable to set the expiration time of logs. ([PR #3257](https://github.com/modmail-dev/Modmail/pull/3257))
2728

2829
### Changed
2930
- Repo moved to https://github.com/modmail-dev/modmail.

bot.py

+2
Original file line numberDiff line numberDiff line change
@@ -1713,6 +1713,8 @@ async def log_expiry(self):
17131713

17141714
now = discord.utils.utcnow()
17151715
expiration_datetime = now - log_expire_after
1716+
# WARNING: comparison is done lexicographically, not by date.
1717+
# This is fine as long as the date is in zero-padded ISO format, which it should be.
17161718
expired_logs = await self.db.logs.delete_many({"closed_at": {"$lte": str(expiration_datetime)}})
17171719

17181720
logger.info(f"Deleted {expired_logs.deleted_count} expired logs.")

0 commit comments

Comments
 (0)