Only run collection updates if there are updates to process
This commit is contained in:
parent
cb02a45e4b
commit
d3b1a0847a
1 changed files with 4 additions and 2 deletions
|
@ -91,6 +91,7 @@ async def unmute():
|
||||||
{"$set": {"active": False}},
|
{"$set": {"active": False}},
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
if updates:
|
||||||
db.jarvis.mutes.bulk_write(updates)
|
db.jarvis.mutes.bulk_write(updates)
|
||||||
|
|
||||||
|
|
||||||
|
@ -116,6 +117,7 @@ async def unban():
|
||||||
{"$set": {"active": False}},
|
{"$set": {"active": False}},
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
if updates:
|
||||||
db.jarvis.bans.bulk_write(updates)
|
db.jarvis.bans.bulk_write(updates)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue