Use Env variables for database
This will enable us to use postgres/sqlite without any code changes Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
parent
869820bc19
commit
a87f37f689
1 changed files with 2 additions and 1 deletions
|
@ -7,6 +7,7 @@ type
|
||||||
ftype*: string
|
ftype*: string
|
||||||
fhash*: string
|
fhash*: string
|
||||||
fileid*: string
|
fileid*: string
|
||||||
|
time*: float
|
||||||
caption*: string
|
caption*: string
|
||||||
|
|
||||||
type
|
type
|
||||||
|
@ -27,7 +28,7 @@ func NewCensoredData*(ftype = ""; fhash = ""; fileid = ""; caption = ""):
|
||||||
func NewBannedUsers*(userid = int64(0), bantime = 0.0, bantype = ""):
|
func NewBannedUsers*(userid = int64(0), bantime = 0.0, bantype = ""):
|
||||||
BannedUsers = BannedUsers(userid: userid, bantime: bantime, bantype: bantype)
|
BannedUsers = BannedUsers(userid: userid, bantime: bantime, bantype: bantype)
|
||||||
|
|
||||||
let dbConn* = sqlite.open("censordata.db", "", "", "")
|
let dbConn* = getDb()
|
||||||
|
|
||||||
proc ManageRateLimit(): void=
|
proc ManageRateLimit(): void=
|
||||||
for i in RateLimiter.keys().toSeq():
|
for i in RateLimiter.keys().toSeq():
|
||||||
|
|
Loading…
Reference in a new issue