Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Use correct column name for activity update
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewFerr committed Nov 13, 2023
1 parent 86cbd35 commit 5036c6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions database/puppet.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,14 @@ func (p *Puppet) UpdateActivityTs(activityTs int64) {
}
p.log.Debugfln("Updating activity time for %s to %d", p.SignalID, activityTs)
p.LastActivityTs = activityTs
_, err := p.db.Exec("UPDATE puppet SET last_activity_ts=$1 WHERE username=$2", p.LastActivityTs, p.SignalID)
_, err := p.db.Exec("UPDATE puppet SET last_activity_ts=$1 WHERE uuid=$2", p.LastActivityTs, p.SignalID)
if err != nil {
p.log.Warnfln("Failed to update last_activity_ts for %s: %v", p.SignalID, err)
}

if p.FirstActivityTs == 0 {
p.FirstActivityTs = activityTs
_, err = p.db.Exec("UPDATE puppet SET first_activity_ts=$1 WHERE username=$2 AND first_activity_ts is NULL", p.FirstActivityTs, p.SignalID)
_, err = p.db.Exec("UPDATE puppet SET first_activity_ts=$1 WHERE uuid=$2 AND first_activity_ts is NULL", p.FirstActivityTs, p.SignalID)
if err != nil {
p.log.Warnfln("Failed to update first_activity_ts %s: %v", p.SignalID, err)
}
Expand Down

0 comments on commit 5036c6d

Please sign in to comment.