// wait for the page to loadtime.Sleep(5*time.Second)
This blocks for 5 seconds unconditionally and doesn't respect context cancellation. If the context is cancelled during this sleep, the function won't notice until after the sleep completes.
**Parent:** #1
## Description
In `sites/archive/archive.go:122`:
```go
// wait for the page to load
time.Sleep(5 * time.Second)
```
This blocks for 5 seconds unconditionally and doesn't respect context cancellation. If the context is cancelled during this sleep, the function won't notice until after the sleep completes.
## Fix
Replace with a context-aware sleep:
```go
select {
case <-time.After(5 * time.Second):
case <-ctx.Done():
return nil, ctx.Err()
}
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Parent: #1
Description
In
sites/archive/archive.go:122:This blocks for 5 seconds unconditionally and doesn't respect context cancellation. If the context is cancelled during this sleep, the function won't notice until after the sleep completes.
Fix
Replace with a context-aware sleep:
Starting work on this as part of PR 6 (also includes #7). Will replace
time.Sleep(5s)with a context-aware select inarchive.go:132.Work finished. PR: #37 (merged)
Replaced
time.Sleep(5s)with context-awareselectusingtime.After.Resolved by PR #37 — replaced
time.Sleep(5s)with context-awareselectontime.Afterandctx.Done().