support using duplicate checker to prevent duplicate submissions for new transaction record

This commit is contained in:
MaysWind
2024-07-07 21:28:07 +08:00
parent a2d6aff28b
commit 847349dcbd
28 changed files with 371 additions and 31 deletions
+10
View File
@@ -7,6 +7,7 @@ import (
"github.com/urfave/cli/v2"
"github.com/mayswind/ezbookkeeping/pkg/datastore"
"github.com/mayswind/ezbookkeeping/pkg/duplicatechecker"
"github.com/mayswind/ezbookkeeping/pkg/exchangerates"
"github.com/mayswind/ezbookkeeping/pkg/log"
"github.com/mayswind/ezbookkeeping/pkg/mail"
@@ -88,6 +89,15 @@ func initializeSystem(c *cli.Context) (*settings.Config, error) {
return nil, err
}
err = duplicatechecker.InitializeDuplicateChecker(config)
if err != nil {
if !isDisableBootLog {
log.BootErrorf("[initializer.initializeSystem] initializes duplicate checker failed, because %s", err.Error())
}
return nil, err
}
err = mail.InitializeMailer(config)
if err != nil {