Changeset 0.15.0 patches (#72)
This commit is contained in:
@@ -237,13 +237,12 @@ func (sc *Scanner) findCandidates(ctx context.Context) []models.Channel {
|
||||
maxAge := time.Now().Add(-candidateMaxAge)
|
||||
|
||||
rows, err := database.DB.QueryContext(ctx, `
|
||||
SELECT c.id, c.user_id, c.model, c.settings::text,
|
||||
SELECT c.id, c.user_id, COALESCE(c.model, ''), COALESCE(c.settings::text, '{}'),
|
||||
COUNT(m.id) AS msg_count,
|
||||
COALESCE(SUM(LENGTH(m.content)), 0) AS total_chars
|
||||
FROM channels c
|
||||
JOIN messages m ON m.channel_id = c.id AND m.deleted_at IS NULL
|
||||
WHERE c.deleted_at IS NULL
|
||||
AND c.type = 'direct'
|
||||
WHERE c.type = 'direct'
|
||||
AND c.is_archived = false
|
||||
AND c.updated_at < $1
|
||||
AND c.updated_at > $2
|
||||
|
||||
Reference in New Issue
Block a user