this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feeds/rapidfire.py: track language

+7 -5
+7 -5
feeds/rapidfire.py
··· 11 11 self.db_cnx.executescript( 12 12 "pragma journal_mode = WAL;" 13 13 "pragma synchronous = OFF;" 14 - "create table if not exists posts (uri text, create_ts timestamp);" 14 + "create table if not exists posts (uri text, create_ts timestamp, lang text);" 15 15 "create index if not exists create_ts_idx on posts(create_ts);" 16 16 ) 17 17 ··· 41 41 post_uri = f'at://{repo}/{path}' 42 42 43 43 with self.db_cnx: 44 - self.db_cnx.execute( 45 - 'insert into posts (uri, create_ts) values (:uri, :ts)', 46 - dict(uri=post_uri, ts=ts) 47 - ) 44 + for lang in record['langs']: 45 + self.db_cnx.execute( 46 + 'insert into posts (uri, create_ts, lang) values (:uri, :ts, :lang)', 47 + dict(uri=post_uri, ts=ts, lang=lang) 48 + ) 49 + 48 50 self.db_cnx.execute( 49 51 "delete from posts where strftime('%s', create_ts) < strftime('%s', 'now', '-15 minutes')" 50 52 )