Michal Iskierko 6d31343205 feat: Waku v2 bridge
Issue #12610
2024-02-22 17:07:59 +01:00

14 lines
243 B
Go

package common
import "context"
// ShouldCancel returns true if the context has been cancelled and task should be aborted
func ShouldCancel(ctx context.Context) bool {
select {
case <-ctx.Done():
return true
default:
}
return false
}