fix (schedule): Various bug fixes.
This commit is contained in:
@@ -489,7 +489,8 @@ class ScheduleCog(LionCog):
|
|||||||
session = slot.sessions.get(guildid, None)
|
session = slot.sessions.get(guildid, None)
|
||||||
if session is None:
|
if session is None:
|
||||||
# Create a new session in the slot and set it up
|
# Create a new session in the slot and set it up
|
||||||
session = await slot.load_sessions(session_data[guildid, slotid])
|
sessions = await slot.load_sessions([session_data[guildid, slotid]])
|
||||||
|
session = sessions[guildid]
|
||||||
slot.sessions[guildid] = session
|
slot.sessions[guildid] = session
|
||||||
if slot.closing.is_set():
|
if slot.closing.is_set():
|
||||||
# This should never happen
|
# This should never happen
|
||||||
|
|||||||
@@ -210,6 +210,7 @@ class TimeSlot:
|
|||||||
await batchrun_per_second(coros, 5)
|
await batchrun_per_second(coros, 5)
|
||||||
|
|
||||||
# Save messageids
|
# Save messageids
|
||||||
|
if sessions:
|
||||||
tmptable = TemporaryTable(
|
tmptable = TemporaryTable(
|
||||||
'_gid', '_sid', '_mid',
|
'_gid', '_sid', '_mid',
|
||||||
types=('BIGINT', 'INTEGER', 'BIGINT')
|
types=('BIGINT', 'INTEGER', 'BIGINT')
|
||||||
|
|||||||
@@ -123,6 +123,9 @@ class TemporaryTable(Expression):
|
|||||||
AS
|
AS
|
||||||
name (col1, col2)
|
name (col1, col2)
|
||||||
"""
|
"""
|
||||||
|
if not self.values:
|
||||||
|
raise ValueError("Cannot flatten CTE with no values.")
|
||||||
|
|
||||||
single_value = sql.SQL("({})").format(sql.SQL(", ").join(sql.Placeholder() for _ in self.columns))
|
single_value = sql.SQL("({})").format(sql.SQL(", ").join(sql.Placeholder() for _ in self.columns))
|
||||||
if self.types:
|
if self.types:
|
||||||
first_value = sql.SQL("({})").format(
|
first_value = sql.SQL("({})").format(
|
||||||
|
|||||||
Reference in New Issue
Block a user