Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
maubot-ethzlunch
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
isgphys
maubot-ethzlunch
Commits
107ab665
Commit
107ab665
authored
2 years ago
by
Tulir Asokan
Browse files
Options
Downloads
Patches
Plain Diff
Fix Python 3.10 compatibility
parent
2b7e732c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
reminder/bot.py
+3
-3
3 additions, 3 deletions
reminder/bot.py
with
3 additions
and
3 deletions
reminder/bot.py
+
3
−
3
View file @
107ab665
...
...
@@ -45,7 +45,7 @@ class ReminderBot(Plugin):
async
def
start
(
self
)
->
None
:
self
.
on_external_config_update
()
self
.
db
=
ReminderDatabase
(
self
.
database
)
self
.
reminder_loop_task
=
asyncio
.
ensure_future
(
self
.
reminder_loop
()
,
loop
=
self
.
loop
)
self
.
reminder_loop_task
=
asyncio
.
create_task
(
self
.
reminder_loop
())
def
on_external_config_update
(
self
)
->
None
:
self
.
config
.
load_and_update
()
...
...
@@ -78,7 +78,7 @@ class ReminderBot(Plugin):
async
def
schedule_nearby_reminders
(
self
,
now
:
datetime
)
->
None
:
until
=
now
+
timedelta
(
minutes
=
1
)
for
reminder
in
self
.
db
.
all_in_range
(
now
,
until
):
asyncio
.
ensure_future
(
self
.
send_reminder
(
reminder
)
,
loop
=
self
.
loop
)
asyncio
.
create_task
(
self
.
send_reminder
(
reminder
))
async
def
send_reminder
(
self
,
reminder
:
ReminderInfo
)
->
None
:
try
:
...
...
@@ -175,7 +175,7 @@ class ReminderBot(Plugin):
now
=
datetime
.
now
(
tz
=
pytz
.
UTC
)
if
(
rem
.
date
-
now
).
total_seconds
()
<
60
and
now
.
minute
==
rem
.
date
.
minute
:
self
.
log
.
debug
(
f
"
Reminder
{
rem
}
is in less than a minute, scheduling now...
"
)
asyncio
.
ensure_future
(
self
.
send_reminder
(
rem
)
,
loop
=
self
.
loop
)
asyncio
.
create_task
(
self
.
send_reminder
(
rem
))
@remind.subcommand
(
"
help
"
,
help
=
"
Usage instructions
"
)
async
def
help
(
self
,
evt
:
MessageEvent
)
->
None
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment