2023-03-04 21:54:32 +00:00
|
|
|
{-# LANGUAGE OverloadedStrings #-}
|
|
|
|
|
|
|
|
module Tasks where
|
|
|
|
|
|
|
|
import Config
|
|
|
|
import Database.MongoDB
|
|
|
|
import ZGoBackend
|
|
|
|
|
|
|
|
main :: IO ()
|
|
|
|
main = do
|
|
|
|
putStrLn "ZGo Recurring Tasks"
|
|
|
|
putStrLn "Reading config..."
|
|
|
|
loadedConfig <- loadZGoConfig "zgo.cfg"
|
|
|
|
pipe <- connect $ host (c_dbHost loadedConfig)
|
|
|
|
j <-
|
|
|
|
access
|
|
|
|
pipe
|
|
|
|
master
|
|
|
|
(c_dbName loadedConfig)
|
|
|
|
(auth (c_dbUser loadedConfig) (c_dbPassword loadedConfig))
|
|
|
|
if j
|
|
|
|
then do
|
|
|
|
putStrLn "Connected to MongoDB!"
|
|
|
|
checkZcashPrices pipe (c_dbName loadedConfig)
|
2023-03-14 15:17:31 +00:00
|
|
|
scanZcash' loadedConfig pipe
|
2023-03-04 21:54:32 +00:00
|
|
|
scanPayments loadedConfig pipe
|
|
|
|
checkPayments pipe (c_dbName loadedConfig)
|
|
|
|
expireOwners pipe (c_dbName loadedConfig)
|
|
|
|
updateLogins pipe loadedConfig
|
2023-04-11 14:58:07 +00:00
|
|
|
expireProSessions pipe (c_dbName loadedConfig)
|
2023-03-04 21:54:32 +00:00
|
|
|
close pipe
|
|
|
|
else fail "MongoDB connection failed!"
|