Skip to content

Commit

Permalink
refactor: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
SuddenGunter committed Feb 6, 2022
1 parent 536a700 commit df988e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ func initAPI(cfg config.Config, pool *pgxpool.Pool) (Worker, *account.Repository
return api.NewServer(cfg, acHandler, bgHandler, txHandler), acRepo, txRepo
}

func initImporter(cfg config.Config, client *mono.Client, acRepo *account.Repository, txRepo *transaction.Repository) Worker {
gen := interval.NewGenerator(txRepo)
acIm := account.NewImporter(client, acRepo)
txIm := transaction.NewImporter(client, txRepo, gen)
func initImporter(cfg config.Config, cl *mono.Client, a *account.Repository, t *transaction.Repository) Worker {
gen := interval.NewGenerator(t)
acIm := account.NewImporter(cl, a)
txIm := transaction.NewImporter(cl, t, gen)
globalIm := importer.NewImporter(acIm, txIm)

return importer.NewWorker(globalIm, cfg.MonoAccountID)
Expand Down
2 changes: 2 additions & 0 deletions importer/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ type Worker struct {

func NewWorker(im *Importer, accountID string) *Worker {
ctx, cancel := context.WithCancel(context.Background())

return &Worker{im: im, accountID: accountID, ctx: ctx, cancel: cancel, wg: &sync.WaitGroup{}}
}

func (w *Worker) Start() {
ticker := time.NewTicker(waitBeforeRuns)

w.wg.Add(1)

for {
Expand Down

0 comments on commit df988e8

Please sign in to comment.