diff --git a/finders/dbfinder/finder.go b/finders/dbfinder/finder.go index 9a9eb2e3..418d1f6e 100644 --- a/finders/dbfinder/finder.go +++ b/finders/dbfinder/finder.go @@ -152,6 +152,9 @@ func (f *Finder) RouteStopBuffer(ctx context.Context, param *model.RouteStopBuff func (f *Finder) FindFeedVersionServiceWindow(ctx context.Context, fvid int) (*model.ServiceWindow, error) { a, _, err := f.fvslCache.Get(ctx, fvid) + if err != nil { + return nil, err + } // Get local time nowLocal := time.Now().In(a.Location) if model.ForContext(ctx).Clock != nil { diff --git a/finders/rtfinder/finder.go b/finders/rtfinder/finder.go index 98bbd396..00ed45bb 100644 --- a/finders/rtfinder/finder.go +++ b/finders/rtfinder/finder.go @@ -264,7 +264,7 @@ func (f *Finder) FindStopTimeUpdate(t *model.Trip, st *model.StopTime) (*model.R // Matched on trip, but no match on stop sequence or stop_id return &model.RTStopTimeUpdate{TripUpdate: rtTrip, LastDelay: copyPtr(lastDelay)}, true } - log.Trace().Str("trip_id", t.TripID.Val).Int("seq", seq).Msgf("no stop time update found") + // log.Trace().Str("trip_id", t.TripID.Val).Int("seq", seq).Msgf("no stop time update found") return nil, false } diff --git a/internal/clock/swcache.go b/internal/clock/swcache.go index 52a8df7c..c74d2250 100644 --- a/internal/clock/swcache.go +++ b/internal/clock/swcache.go @@ -2,6 +2,7 @@ package clock import ( "context" + "fmt" "sync" "time" @@ -47,6 +48,9 @@ func (f *ServiceWindowCache) Get(ctx context.Context, fvid int) (ServiceWindow, if err != nil { return a, false, err } + if fvData.Location == nil { + return a, false, fmt.Errorf("unable to get cached default timezone for feed version %d", fvid) + } a.Location = fvData.Location // Get fallback week from FVSL data