| Commit message (Collapse) | Author | Age | Lines |
| |
|
|
|
|
|
|
|
| |
Main concern is someone trying to cancel a task directly. The workaround
for the race condition relies on the task only being cancelled via
Scheduler.cancel_task(), particularly because it removes the task from
the dictionary. The done callback will not remove from the dictionary
if it sees the task has already been cancelled. So it's a bad idea to
cancel tasks directly...
|
| |
|
|
|
| |
Because deactivate_infraction() explicitly cancels the scheduled task,
it now runs in a separate task to avoid prematurely cancelling itself.
|
| |
|
|
|
|
|
|
| |
This design makes more sense and is more convenient than requiring tasks
to be responsible for cancelling themselves.
* Rename _handle_task_exception to _task_done_callback
* Add trace logging
|
| |
|
|
|
|
|
| |
Explicitly retrieves the task's exception, which will raise the
exception if one exists.
* Rename _suppress_cancelled_error to _handle_task_exception
|
| |
|
|
|
|
|
| |
asyncio.create_task() exists and will already use the running loop in
the current thread. Because there is no intention of using a different
loop in a different thread anywhere in the program for the foreseeable
future, the loop parameter is redundant.
|
| | |
|
| |
|
|
|
|
|
|
| |
It's redundant because the done callback only takes a single line to add
and can be added in schedule_task().
* Use Task as the type hint rather than Future for
_suppress_cancelled_error()
|
| | |
|
| |\
| |
| | |
Stop scheduling expiration of permanent infractions on edit
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
https://github.com/python-discord/bot/issues/751
The infraction edit command defined in `bot.cogs.moderation.management` contained a bug causing it to attempt to schedule an expiration task when turning a temporary infraction into a permanent infraction. Since the "expires_at" field of a permanent infractions is `None`, this caused an exception to occur in the scheduler:
Traceback (most recent call last):
File "/bot/bot/cogs/moderation/scheduler.py", line 415, in _scheduled_task
expiry = dateutil.parser.isoparse(infraction["expires_at"]).replace(tzinfo=None)
File "/usr/local/lib/python3.7/site-packages/dateutil/parser/isoparser.py", line 37, in func
return f(self, str_in, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/dateutil/parser/isoparser.py", line 134, in isoparse
components, pos = self._parse_isodate(dt_str)
File "/usr/local/lib/python3.7/site-packages/dateutil/parser/isoparser.py", line 208, in _parse_isodate
return self._parse_isodate_common(dt_str)
File "/usr/local/lib/python3.7/site-packages/dateutil/parser/isoparser.py", line 213, in _parse_isodate_common
len_str = len(dt_str)
TypeError: object of type 'NoneType' has no len()
I have solved this by adding a check that makes sure we only schedule an expiration task when the `"expires_at"` field has a truthy value (which all valid datetime strings are) using `if request_data['expires_at']`.
IMPORTANT NOTE: While it's tempting to just skip the entire scheduling block for permanent infractions, it's essential to unschedule existing expiration tasks for this infraction as we're changing a temporary infraction to a permanent infraction.
This commit closes #751
|
| |\
| |
| | |
Fix pagniation module for "last page" reaction
|
| |/
|
|
| |
Fixes #746.
|
| |\
| |
| | |
Separate message/embed deletion and reaction deletion emojis
|
| | |
| |
| |
| |
| | |
It could be confused with the delete reaction. Clearing reactions
manually is rarely a useful feature anyway.
|
| | |\
| |/
|/| |
|
| |\ \
| | |
| | | |
Update discord.py to 1.3.1
|
| | | | |
|
| |/ / |
|
| |\ \
| | |
| | | |
Make it easier for user to search for tags
|
| | |\ \
| |/ /
|/| | |
|
| |\ \ \
| | | |
| | | | |
Remove prometheus related code
|
| | |\ \ \
| |/ / /
|/| | | |
|
| |\ \ \ \
| | | | |
| | | | | |
Move tools and questions guide to under resources
|
| | | | | | |
|
| |/ / / /
| | | |
| | | |
| | | |
| | | | |
After the wiki pages adjustment to the resources page, these two urls are needing to be updated to point to the new correct locations for each page.
Tools will be under resources, and Asking Good Questions is a guide, so will be under Guides.
|
| |\ \ \ \
| | | | |
| | | | | |
Relay attachments to log channel before filters delete message
|
| | | | | |
| | | | |
| | | | | |
Previously used a leading underscore, but that's usually meant for non-used names.
|
| | | | | | |
|
| | |\ \ \ \
| |/ / / /
|/| | | | |
|
| | | | | | |
|
| | | | | | |
|
| | |\ \ \ \ |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The destination channel can be retrieved be accessing a message's guild.
* Remove unused queue_consumption_tasks attribute.
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This makes it more likely to successfully save an attachment after it's
been deleted.
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | | |
|
| | |\ \ \ \ \ |
|
| | | | | | | | |
|
| | | | | | | | |
|
| | | | | | | |
| | | | | | |
| | | | | | | |
Co-Authored-By: Mark <[email protected]>
|
| | | | | | | | |
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
So they are re-uploaded before being deleted
|
| | | | | | | | |
|
| | | | | | | |
| | | | | | |
| | | | | | | |
Co-authored-by: Shirayuki Nekomata <[email protected]>
|