Fix for funcom's roster delays.
Orgbots will run the roster 24 hours and 15 minutes after the last one funcom published on PORK; Onlinebots 24 hours and 10 minutes of the slowest roster maintained.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import datetime
|
||||
import json
|
||||
import time
|
||||
import typing
|
||||
@@ -196,6 +197,14 @@ class OrgRosterController:
|
||||
[self.public_channel_service.org_id])
|
||||
conn.commit()
|
||||
self.bot.send_org_message('Successfully updated the roster.')
|
||||
d = datetime.datetime.strptime(result[2] + " +0000", '%Y/%m/%d %H:%M:%S %z').timestamp()
|
||||
while (d + 24*60*60) < datetime.datetime.now().timestamp():
|
||||
d += 24*60*60
|
||||
self.db.exec("UPDATE timer_event SET next_run=? WHERE handler=? AND event_sub_type=?", [
|
||||
int(d+24*60*60 + 15*60),
|
||||
"modules.orgbot.org.org_roster_controller.OrgRosterController.update_roster",
|
||||
86400
|
||||
])
|
||||
|
||||
@event(PublicChannelService.ORG_MSG_EVENT, "Update org roster when characters join or leave", is_hidden=True)
|
||||
def org_msg_event(self, _, event_data):
|
||||
|
||||
Reference in New Issue
Block a user