Replace REPLACE INTO usage

pull/23/head
maru 6 months ago
parent 3489ae91bf
commit c76746ad35
No known key found for this signature in database
GPG Key ID: 37689350E9CD0F0D

@ -237,7 +237,7 @@ func IsActiveSession(uuid []byte, clientSessionId string) (bool, error) {
}
func UpdateActiveSession(uuid []byte, clientSessionId string) error {
_, err := handle.Exec("REPLACE INTO activeClientSessions VALUES (?, ?)", uuid, clientSessionId)
_, err := handle.Exec("INSERT INTO activeClientSessions (uuid, clientSessionId) VALUES (?, ?) ON DUPLICATE KEY UPDATE clientSessionId = ?", uuid, clientSessionId, clientSessionId)
if err != nil {
return err
}

Loading…
Cancel
Save