SelectLatestTime picks the latest update timestamp out of the two.
(t1, t2 time.Time)
| 65 | |
| 66 | // SelectLatestTime picks the latest update timestamp out of the two. |
| 67 | func 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. |
| 77 | func RangesToSql(in []t.Range) (string, []any) { |
no outgoing calls
searching dependent graphs…