a geicko-2 based round robin ranking system designed to test c++ battleship submissions battleship.dunkirk.sh
1package main 2 3import ( 4 "context" 5 "log" 6 "time" 7) 8 9// Background worker that processes pending submissions and bracket matches 10func startWorker(ctx context.Context) { 11 ticker := time.NewTicker(10 * time.Second) 12 defer ticker.Stop() 13 14 // Process immediately on start 15 if err := processSubmissions(); err != nil { 16 log.Printf("Worker error (submissions): %v", err) 17 } 18 19 for { 20 select { 21 case <-ctx.Done(): 22 return 23 case <-ticker.C: 24 if err := processSubmissions(); err != nil { 25 log.Printf("Worker error (submissions): %v", err) 26 } 27 } 28 } 29}