Keep active IRC listener users from expiring (closes #121)
check / check (push) Waiting to run
check / check (push) Waiting to run
Every command a registered IRC listener client sends, PING and PONG included, now sets last_seen on its session and its client, so the idle cleanup no longer removes an IRC user who is still active; one who sends nothing for SESSION_IDLE_TIMEOUT is still removed. The two UPDATEs that GetSessionByToken ran for every authenticated HTTP API request move into UpdateLastSeen, which both transports now call. The IRC listener refreshes on every command, with no interval between writes: that is what every HTTP API request already costs. README.md describes last_seen to match. Model: opus-5-5 Co-authored-by: clawbot <sneak+clawbot@sneak.cloud>
This commit was merged in pull request #126.
This commit is contained in:
@@ -368,6 +368,17 @@ func (c *Conn) handleMessage(
|
||||
return
|
||||
}
|
||||
|
||||
// Every command is activity, so the idle cleanup must not
|
||||
// remove this user.
|
||||
err := c.database.UpdateLastSeen(
|
||||
ctx, c.sessionID, c.clientID,
|
||||
)
|
||||
if err != nil {
|
||||
c.log.Error(
|
||||
"failed to update last_seen", "error", err,
|
||||
)
|
||||
}
|
||||
|
||||
handler, ok := c.commands[msg.Command]
|
||||
if !ok {
|
||||
c.sendNumeric(
|
||||
|
||||
Reference in New Issue
Block a user