ci / api / api (push) Successful in 1m11s
ci / db / db (push) Failing after 23s
ci / mobile / mobile (Metro-бандл Android) (push) Successful in 1m29s
ci / ts / ts (packages + web) (push) Successful in 3m15s
ci / contract / contract (сгенерированный код совпадает с openapi.yaml) (push) Successful in 1m27s
17 lines
546 B
Go
17 lines
546 B
Go
package social
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
// Existing authenticated social/listening polls serve as heartbeats, including
|
|
// while playback is paused or music visibility is off. Coalesce frequent polls
|
|
// to one write per account per ten seconds; abandoned clients expire in 45s.
|
|
func (s *Store) markPresent(ctx context.Context, id uuid.UUID) error {
|
|
_, e := s.pool.Exec(ctx, `UPDATE users SET social_seen_at=now()
|
|
WHERE id=$1 AND (social_seen_at IS NULL OR social_seen_at<now()-interval '10 seconds')`, id)
|
|
return e
|
|
}
|