Skip to content

Commit

Permalink
fix: fully revert workers
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzalevski committed Apr 14, 2021
1 parent 1ae0a02 commit a30d16b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/sgtm/processing_worker.go
Expand Up @@ -61,17 +61,18 @@ func (svc *Service) processingLoop(i int) error {
// track migrations
{
var outdated []*sgtmpb.Post
if err := svc.rodb().
err := svc.rodb().
Where(sgtmpb.Post{Kind: sgtmpb.Post_TrackKind}).
Where("processing_error IS NULL OR processing_error == ''").
Where("processing_version IS NULL OR processing_version < ?", len(svc.processingWorker.trackMigrations)).
Preload("Author").
Find(&outdated).
Error; err != nil {
Error
if err != nil {
return fmt.Errorf("failed to fetch tracks that need to be processed: %w", err)
}

err := svc.rwdb().Transaction(func(tx *gorm.DB) error {
err = svc.rwdb().Transaction(func(tx *gorm.DB) error {
for _, entryPtr := range outdated {
entry := entryPtr
version := 1
Expand Down

0 comments on commit a30d16b

Please sign in to comment.