Skip to content

Commit

Permalink
Ignore fetch wait
Browse files Browse the repository at this point in the history
  • Loading branch information
irees committed Jan 25, 2024
1 parent 4fbc0c1 commit 7e8ac11
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion finders/dbfinder/finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ func (f *Finder) FindRoutes(ctx context.Context, limit *int, after *model.Cursor
}

func (f *Finder) FindStops(ctx context.Context, limit *int, after *model.Cursor, ids []int, where *model.StopFilter) ([]*model.Stop, error) {
log.For(ctx).Info().Msg("find stops")
var ents []*model.Stop
active := true
if len(ids) > 0 || (where != nil && where.FeedVersionSha1 != nil) {
Expand Down
7 changes: 4 additions & 3 deletions workers/fetch_enqueue_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import (
)

type FetchEnqueueWorker struct {
URLTypes []string `json:"url_types"`
FeedIDs []string `json:"feed_ids"`
IgnoreFetchWait bool `json:"ignore_fetch_wait"`
URLTypes []string `json:"url_types"`
FeedIDs []string `json:"feed_ids"`
}

func (w *FetchEnqueueWorker) Run(ctx context.Context, job jobs.Job) error {
Expand Down Expand Up @@ -76,7 +77,7 @@ func (w *FetchEnqueueWorker) Run(ctx context.Context, job jobs.Job) error {
}
var feedsOk []actions.CheckFetchWaitResult
for _, check := range feedChecks {
if check.OK() {
if check.OK() || w.IgnoreFetchWait {
feedsOk = append(feedsOk, check)
}
}
Expand Down
5 changes: 3 additions & 2 deletions workers/static_fetch_worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ func TestStaticFetchWorker(t *testing.T) {
jobQueue.AddJob(jobs.Job{
JobType: "static-fetch",
JobArgs: map[string]any{
"feed_id": a,
"feed_url": aurl,
"feed_id": a,
"feed_url": aurl,
"ignore_fetch_wait": true,
},
})
time.Sleep(2 * time.Second)
Expand Down

0 comments on commit 7e8ac11

Please sign in to comment.