chore: fix refresh query
This commit is contained in:
parent
e58cd8e3f1
commit
9db54a0ad9
7
feed.go
7
feed.go
@ -607,15 +607,14 @@ func chunk(args []any, qry func(int) (string, int), maxArgs int) iter.Seq2[strin
|
||||
func refreshLastTwt(ctx context.Context, db db) error {
|
||||
qry := `
|
||||
delete from last_twt_on;
|
||||
insert into last_twt_on
|
||||
insert into last_twt_on (feed_id, last_twt_on)
|
||||
select distinct
|
||||
feed_id,
|
||||
max(strftime('%Y-%m-%dT%H:%M:%fZ', (substring(text, 1, instr(text, ' ')-1)))) last_twt_on
|
||||
from twts
|
||||
group by feed_id
|
||||
on conflict(feed_id);
|
||||
group by feed_id;
|
||||
delete from twt_mentions;
|
||||
insert into twt_mentions
|
||||
insert into twt_mentions (ulid, feed_id)
|
||||
select distinct
|
||||
ulid,
|
||||
unhex(replace(trim(value,'{}'),'-','')) feed_id
|
||||
|
Loading…
x
Reference in New Issue
Block a user