mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 08:23:45 +00:00
test(multiplayer): verify two-player proposal round trip
This commit is contained in:
@@ -47,6 +47,7 @@ type Worker struct {
|
||||
Now func() time.Time
|
||||
NextID func() string
|
||||
Prepare PrepareFunc
|
||||
OnError func(error)
|
||||
}
|
||||
|
||||
// Run polls until cancellation. A failed attempt is returned so a supervisor
|
||||
@@ -57,6 +58,9 @@ func (w Worker) Run(ctx context.Context, interval time.Duration) error {
|
||||
}
|
||||
for {
|
||||
if _, err := w.RunOnce(ctx); err != nil {
|
||||
if w.OnError != nil {
|
||||
w.OnError(err)
|
||||
}
|
||||
if errors.Is(err, ErrWorkerNotConfigured) || errors.Is(err, ErrUnsupportedPlaylist) || errors.Is(err, ErrInvalidMatcherSize) {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user