mirror of
https://github.com/GrassrootsEconomics/cic-dw.git
synced 2024-12-22 10:57:33 +01:00
fixes: deepsource suggestions
This commit is contained in:
parent
f20f4ca22d
commit
7497d0cd41
@ -2,6 +2,7 @@ package syncer
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/georgysavva/scany/pgxscan"
|
"github.com/georgysavva/scany/pgxscan"
|
||||||
"github.com/hibiken/asynq"
|
"github.com/hibiken/asynq"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
@ -11,7 +12,7 @@ type tableCount struct {
|
|||||||
Count int `db:"count"`
|
Count int `db:"count"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Syncer) CacheSyncer(ctx context.Context, t *asynq.Task) error {
|
func (s *Syncer) CacheSyncer(ctx context.Context, _ *asynq.Task) error {
|
||||||
_, err := s.db.Exec(ctx, s.queries["cache-syncer"])
|
_, err := s.db.Exec(ctx, s.queries["cache-syncer"])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Err(err).Msg("cache syncer task failed")
|
log.Err(err).Msg("cache syncer task failed")
|
||||||
|
@ -16,7 +16,7 @@ type tokenCursor struct {
|
|||||||
CursorPos string `db:"cursor_pos"`
|
CursorPos string `db:"cursor_pos"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Syncer) TokenSyncer(ctx context.Context, t *asynq.Task) error {
|
func (s *Syncer) TokenSyncer(ctx context.Context, _ *asynq.Task) error {
|
||||||
var lastCursor tokenCursor
|
var lastCursor tokenCursor
|
||||||
|
|
||||||
if err := pgxscan.Get(ctx, s.db, &lastCursor, s.queries["cursor-pos"], 3); err != nil {
|
if err := pgxscan.Get(ctx, s.db, &lastCursor, s.queries["cursor-pos"], 3); err != nil {
|
||||||
|
@ -2,12 +2,13 @@ package syncer
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/georgysavva/scany/pgxscan"
|
"github.com/georgysavva/scany/pgxscan"
|
||||||
"github.com/hibiken/asynq"
|
"github.com/hibiken/asynq"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *Syncer) UssdSyncer(ctx context.Context, t *asynq.Task) error {
|
func (s *Syncer) UssdSyncer(ctx context.Context, _ *asynq.Task) error {
|
||||||
_, err := s.db.Exec(ctx, s.queries["ussd-syncer"])
|
_, err := s.db.Exec(ctx, s.queries["ussd-syncer"])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Err(err).Msg("ussd syncer task failed")
|
log.Err(err).Msg("ussd syncer task failed")
|
||||||
|
Loading…
Reference in New Issue
Block a user