many fixes
This commit is contained in:
@@ -79,6 +79,15 @@ func (s *Store) SetAccountStatus(ctx context.Context, id int64, status string) e
|
||||
return err
|
||||
}
|
||||
|
||||
// ResetAccountCounters zeroes the per-account copied/skipped/error counts at the
|
||||
// start of a run so a re-run reflects only the current run's totals instead of
|
||||
// accumulating on top of the previous run (IncAccountCounters is additive).
|
||||
func (s *Store) ResetAccountCounters(ctx context.Context, id int64) error {
|
||||
_, err := s.Pool.Exec(ctx,
|
||||
`UPDATE accounts SET copied_count=0, skipped_count=0, error_count=0 WHERE id=$1`, id)
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *Store) IncAccountCounters(ctx context.Context, id, copied, skipped, errs int64) error {
|
||||
_, err := s.Pool.Exec(ctx,
|
||||
`UPDATE accounts SET copied_count=copied_count+$2,
|
||||
|
||||
Reference in New Issue
Block a user