Pix4D / cogito

Concourse resource for GitHub Commit Status and Google Chat notifications
MIT License
34 stars 14 forks source link

cogito: error: put: internal error: unexpected: negative sleep time: 0s #124

Closed marco-m-pix4d closed 1 year ago

marco-m-pix4d commented 1 year ago

Just observed in our deployment:

[INFO]  cogito: This is the Cogito GitHub status resource. Tag: 0.10.1, commit: 05c92db, build date: 2023-05-31
[INFO]  cogito.put.ghCommitStatus: GitHub HTTP request: attempt=1 max=3
[INFO]  cogito.put.ghCommitStatus: Sleeping for: time=4m47s
[INFO]  cogito.put.ghCommitStatus: GitHub HTTP request: attempt=2 max=3
cogito: error: put: internal error: unexpected: negative sleep time: 0s

See also #123.

marco-m-pix4d commented 1 year ago

@aliculPix4D pointed out:

it could be

https://github.com/Pix4D/cogito/blob/05c92db9c94e571b2f6268783dfb7dcf5063db46/cogito/ghcommitsink.go#L42

missing an offset, since rand can return 0.