rename system user
This commit is contained in:
parent
0ad7a41629
commit
de62f04bf4
|
@ -60,7 +60,7 @@ proc getTweetsFrom*(url: string, username: string): seq[Tweet] =
|
||||||
proc updateTweetsOnce*() {. gcsafe .} =
|
proc updateTweetsOnce*() {. gcsafe .} =
|
||||||
var db = open("./data/twtxt.db", nil, nil, nil)
|
var db = open("./data/twtxt.db", nil, nil, nil)
|
||||||
|
|
||||||
var users = db.getAllRows sql"select * from users where username != 'system'"
|
var users = db.getAllRows sql"select * from users where username != 'twtxtlist'"
|
||||||
|
|
||||||
for user in users.items():
|
for user in users.items():
|
||||||
echo "updating " & $user
|
echo "updating " & $user
|
||||||
|
@ -75,4 +75,5 @@ proc updateTweetsOnce*() {. gcsafe .} =
|
||||||
try:
|
try:
|
||||||
db.exec(sql"insert into tweets values(null, ?, ?, ?);", username, tweet.date.timeInfoToTime().toSeconds().int(), tweet.message)
|
db.exec(sql"insert into tweets values(null, ?, ?, ?);", username, tweet.date.timeInfoToTime().toSeconds().int(), tweet.message)
|
||||||
except: discard
|
except: discard
|
||||||
except: discard
|
except:
|
||||||
|
echo getCurrentExceptionMsg()
|
||||||
|
|
|
@ -17,7 +17,7 @@ proc updateSystemUser() =
|
||||||
echo "wtf it's nil?"
|
echo "wtf it's nil?"
|
||||||
return
|
return
|
||||||
|
|
||||||
let tweets = db.getAllRows(sql"select * from tweets where username='system'")
|
let tweets = db.getAllRows(sql"select * from tweets where username='twtxtlist'")
|
||||||
|
|
||||||
for tweet in tweets.items:
|
for tweet in tweets.items:
|
||||||
let tweetObj = tweet.fromDBRow()
|
let tweetObj = tweet.fromDBRow()
|
||||||
|
|
Loading…
Reference in New Issue