diff --git a/bmdevice.go b/bmdevice.go index 3f97bf8..e192210 100644 --- a/bmdevice.go +++ b/bmdevice.go @@ -57,7 +57,8 @@ func runBMDeviceSync(db *sql.DB) { // Only poll repeaters that haven't been polled in the last 3 days rows, err := db.Query(`SELECT id, callsign, freq_tx, freq_rx FROM repeaters WHERE network = 'Brandmeister' AND hotspot = 0 - AND (last_polled IS NULL OR last_polled < NOW() - INTERVAL '3 days')`) + AND (last_polled IS NULL OR last_polled < NOW() - INTERVAL '3 days') + ORDER BY CASE WHEN LEFT(id::text, 3) = '262' THEN 0 WHEN LEFT(id::text, 1) = '2' THEN 1 ELSE 2 END, callsign`) if err != nil { log.Printf("BM device sync: failed to query repeaters: %v", err) return