fixes: deepsource suggestions

This commit is contained in:
Mohamed Sohail 2022-07-04 16:01:44 +03:00
parent f20f4ca22d
commit 7497d0cd41
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D
3 changed files with 5 additions and 3 deletions

View File

@ -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")

View File

@ -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 {

View File

@ -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")