lookup tweets in parallel
This commit is contained in:
parent
ac6dd0f0e3
commit
2e5c37a97c
|
@ -69,13 +69,3 @@ proc updateTweetsByUser*(db: DBConn, username, url: string) {. gcsafe .} =
|
||||||
except: discard
|
except: discard
|
||||||
except:
|
except:
|
||||||
echo getCurrentExceptionMsg()
|
echo getCurrentExceptionMsg()
|
||||||
|
|
||||||
proc updateTweetsOnce*() {. gcsafe .} =
|
|
||||||
var db = open("./data/twtxt.db", nil, nil, nil)
|
|
||||||
|
|
||||||
var users = db.getAllRows sql"select * from users where username != 'twtxtlist'"
|
|
||||||
|
|
||||||
for user in users.items():
|
|
||||||
echo "updating " & $user
|
|
||||||
|
|
||||||
db.updateTweetsByUser(user[1], user[2])
|
|
||||||
|
|
|
@ -1,5 +1,15 @@
|
||||||
import db_sqlite, os, streams, threadpool, twtxt
|
import db_sqlite, os, streams, threadpool, twtxt
|
||||||
|
|
||||||
|
proc updateTweetsOnce() {. gcsafe .} =
|
||||||
|
var db = open("./data/twtxt.db", nil, nil, nil)
|
||||||
|
|
||||||
|
var users = db.getAllRows sql"select * from users where username != 'twtxtlist'"
|
||||||
|
|
||||||
|
for user in users.items():
|
||||||
|
echo "updating " & $user
|
||||||
|
|
||||||
|
spawn db.updateTweetsByUser(user[1], user[2])
|
||||||
|
|
||||||
proc updateSystemUser() =
|
proc updateSystemUser() =
|
||||||
let
|
let
|
||||||
fname = "public" / "twtxt.txt"
|
fname = "public" / "twtxt.txt"
|
||||||
|
|
Loading…
Reference in New Issue