forked from Keelrleek/Harbor
Resuming one agent under a later 'stop everyone' works even when its own flag is already off: the human's resume records its time
This commit is contained in:
1 parent
440f148c87
commit
d755ab8a76
2 files changed
+20
-1
No files matched your search
+7
-1
@@ -990,7 +990,13 @@ class Harbor(WorkMixin, ExtrasMixin, FlowMixin, LaunchMixin):
|
||||
(by, origin, reason, now, key))
|
||||
return False
|
||||
if current and current["value"] == "off" and value == "off" and not until_at and not current.get("until"):
|
||||
return False
|
||||
if by != self.human:
|
||||
return False
|
||||
# the human resuming one agent under a later 'stop everyone': record the time, so this resume is
|
||||
# the most recent decision for that agent (decision() compares set_at)
|
||||
c.execute("UPDATE flags SET set_by=?, origin=?, relay_of=NULL, set_at=? WHERE key=?",
|
||||
(by, origin, now, key))
|
||||
return True
|
||||
c.execute("INSERT INTO flags(key, value, set_by, origin, relay_of, reason, set_at, until) VALUES (?,?,?,?,?,?,?,?) "
|
||||
"ON CONFLICT(key) DO UPDATE SET value=excluded.value, set_by=excluded.set_by, "
|
||||
"origin=excluded.origin, relay_of=excluded.relay_of, reason=excluded.reason, set_at=excluded.set_at, "
|
||||
|
||||
Reference in new issue
Block a user