Skip to content

Commit

Permalink
Fix concurrent map write (#292)
Browse files Browse the repository at this point in the history
* Fix concurrent map write
  • Loading branch information
irees authored Dec 6, 2024
1 parent 7b5d4f0 commit ccbb33c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion cmd/tlserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ func (cmd *ServerCommand) AddFlags(fl *pflag.FlagSet) {
fl.BoolVar(&cmd.LoadAdmins, "load-admins", false, "Load admin polygons from database into memory")
fl.IntVar(&cmd.LoaderBatchSize, "loader-batch-size", 100, "GraphQL Loader batch size")
fl.IntVar(&cmd.LoaderStopTimeBatchSize, "loader-stop-time-batch-size", 1, "GraphQL Loader batch size for StopTimes")

}

func (cmd *ServerCommand) Parse(args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion internal/clock/swcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ func NewServiceWindowCache(db sqlx.Ext) *ServiceWindowCache {

func (f *ServiceWindowCache) Get(ctx context.Context, fvid int) (ServiceWindow, bool, error) {
f.lock.Lock()
defer f.lock.Unlock()
a, ok := f.fvslWindows[fvid]
f.lock.Unlock()
if ok {
return a, ok, nil
}
Expand Down

0 comments on commit ccbb33c

Please sign in to comment.