MCPcopy Index your code
hub / github.com/tinode/chat / SelectLatestTime

Function SelectLatestTime

server/db/common/common.go:67–74  ·  view source on GitHub ↗

SelectLatestTime picks the latest update timestamp out of the two.

(t1, t2 time.Time)

Source from the content-addressed store, hash-verified

65
66// SelectLatestTime picks the latest update timestamp out of the two.
67func SelectLatestTime(t1, t2 time.Time) time.Time {
68 if t1.Before(t2) {
69 // Subscription has not changed recently, use user's update timestamp.
70 return t2
71 }
72
73 return t1
74}
75
76// RangesToSql converts a slice of ranges to SQL BETWEEN or IN() constraint and arguments.
77func RangesToSql(in []t.Range) (string, []any) {

Callers 5

TopicsForUserMethod · 0.92
TopicsForUserMethod · 0.92
TopicsForUserMethod · 0.92
TopicsForUserMethod · 0.92
TestSelectLatestTimeFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestSelectLatestTimeFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…