mirror of
https://github.com/abhinavxd/libredesk.git
synced 2026-09-24 03:16:20 +00:00
fix: handle null user last active time when marking agents offline.
This commit is contained in:
@@ -97,7 +97,10 @@ WHERE id = $1;
|
||||
-- name: update-inactive-offline
|
||||
UPDATE users
|
||||
SET availability_status = 'offline'
|
||||
WHERE last_active_at < now() - interval '5 minutes' and availability_status != 'offline';
|
||||
WHERE
|
||||
type = 'agent'
|
||||
AND (last_active_at IS NULL OR last_active_at < NOW() - INTERVAL '5 minutes')
|
||||
AND availability_status != 'offline';
|
||||
|
||||
-- name: get-permissions
|
||||
SELECT DISTINCT unnest(r.permissions)
|
||||
|
||||
Reference in New Issue
Block a user