|
6 | 6 | "net/http" |
7 | 7 | "reflect" |
8 | 8 | "strings" |
| 9 | + "time" |
9 | 10 |
|
10 | 11 | "github.com/flashbots/gh-artifacts-sync/job" |
11 | 12 | "github.com/flashbots/gh-artifacts-sync/logutils" |
@@ -124,6 +125,12 @@ func (s *Server) webhookProcessRegistryPackageEvent(ctx context.Context, e *gith |
124 | 125 | return nil |
125 | 126 | } |
126 | 127 |
|
| 128 | + if e.Repository.PushedAt != nil && time.Since(e.Repository.PushedAt.Time) > time.Minute { |
| 129 | + l.Warn("Github event was delivered late", |
| 130 | + zap.Duration("delay", time.Since(e.Repository.PushedAt.Time)), |
| 131 | + ) |
| 132 | + } |
| 133 | + |
127 | 134 | j := job.NewSyncContainerRegistryPackage( |
128 | 135 | e.RegistryPackage, |
129 | 136 | e.Repository, |
@@ -174,6 +181,12 @@ func (s *Server) webhookProcessReleaseEvent(ctx context.Context, e *github.Relea |
174 | 181 | return nil |
175 | 182 | } |
176 | 183 |
|
| 184 | + if e.Release.PublishedAt != nil && time.Since(e.Release.PublishedAt.Time) > time.Minute { |
| 185 | + l.Warn("Github event was delivered late", |
| 186 | + zap.Duration("delay", time.Since(e.Release.PublishedAt.Time)), |
| 187 | + ) |
| 188 | + } |
| 189 | + |
177 | 190 | errs := make([]error, 0) |
178 | 191 |
|
179 | 192 | jobsCount := 0 |
@@ -296,6 +309,12 @@ func (s *Server) webhookProcessWorkflowEvent(ctx context.Context, e *github.Work |
296 | 309 | return nil |
297 | 310 | } |
298 | 311 |
|
| 312 | + if e.Repo.PushedAt != nil && time.Since(e.Repo.PushedAt.Time) > time.Minute { |
| 313 | + l.Warn("Github event was delivered late", |
| 314 | + zap.Duration("delay", time.Since(e.Repo.PushedAt.Time)), |
| 315 | + ) |
| 316 | + } |
| 317 | + |
299 | 318 | fname, err := job.Save(job.NewDiscoverWorkflowArtifacts(e), s.cfg.Dir.Jobs) |
300 | 319 | if err != nil { |
301 | 320 | l.Error("Failed to persist a job", |
|
0 commit comments