zgo-backend/app/Tasks.hs

34 lines
899 B
Haskell
Raw Normal View History

{-# 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-10-13 20:20:01 +00:00
{-scanPayments loadedConfig pipe-}
scanTxNative 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)
close pipe
else fail "MongoDB connection failed!"