Skip to content

Commit

Permalink
aggressive initial ssgen load
Browse files Browse the repository at this point in the history
  • Loading branch information
motoki317 committed Jun 6, 2023
1 parent d60200c commit e781405
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/usecase/ssgen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ func (s *generatorService) Start(_ context.Context) error {
go retry.Do(ctx, func(ctx context.Context) error {
return s.client.ConnectSSGen(ctx, s.onRequest)
}, 1*time.Second, 60*time.Second)
go s.reload()
go func() {
for i := 0; i < 300; i++ {
s.reload()
if s.reloaded.Load() {
break
}
<-time.After(1 * time.Second)
}
}()

s.running.Store(true)
return nil
Expand Down

0 comments on commit e781405

Please sign in to comment.