dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit 35ce462c50ad5aff86770a7413c93aca137409e1
parent fe96d5b7c71f6d8621bea53c9de1e51470a8f55b
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Thu, 29 Aug 2024 12:06:44 -0700

speed up start

Diffstat:
Mpkg/actions/actions.go | 22++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/pkg/actions/actions.go b/pkg/actions/actions.go @@ -77,21 +77,23 @@ func Start(c *cli.Context) error { config.CaptchaDifficulty.Store(settings.CaptchaDifficulty) config.MoneroPrice.Store(settings.MoneroPrice) - walletClient := config.Xmr() - utils.SGo(func() { cleanupDatabase(db) }) utils.SGo(func() { managers.ActiveUsers.CleanupUsersCache() }) utils.SGo(func() { xmrWatch(db) }) utils.SGo(func() { openBrowser(noBrowser, int64(port)) }) - poker.Refund(db) - - if !walletIsBalanced(db, walletClient) { - // TODO: automatically send transactions that are not processed - config.PokerWithdrawEnabled.Store(false) - logrus.Error("wallet is not balanced") - dutils.RootAdminNotify(db, "wallet is not balanced; poker withdraw disabled") - } + go func() { + logrus.Info("start xmr check") + walletClient := config.Xmr() + poker.Refund(db) + if !walletIsBalanced(db, walletClient) { + // TODO: automatically send transactions that are not processed + config.PokerWithdrawEnabled.Store(false) + logrus.Error("wallet is not balanced") + dutils.RootAdminNotify(db, "wallet is not balanced; poker withdraw disabled") + } + logrus.Info("done xmr check") + }() interceptors.LoadFilters(db) interceptors.ChessInstance = interceptors.NewChess(db)