Skip to content

Commit a0ca55d

Browse files
committed
nfqueue: test if linux, panic if not
1 parent 2e30c71 commit a0ca55d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

providers/http/nfqueue/nfqueue.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ import (
77
"bytes"
88
"context"
99
"fmt"
10+
"log"
1011
"net"
1112
"net/http"
1213
"os/exec"
14+
"runtime"
1315
"strings"
1416
"time"
1517

@@ -173,6 +175,10 @@ func (w *HTTPProvider) serve(domain, token, keyAuth string) error {
173175
}
174176

175177
func (w *HTTPProvider) Present(domain, token, keyAuth string) error {
178+
// test if OS is linux, otherwise no point running this nfqueue is linux thing
179+
if runtime.GOOS != "linux" {
180+
log.Panicf("[%s] http-nfq provider isn't implimented non-linux", domain)
181+
}
176182
w.context, w.cancel = context.WithCancel(context.Background())
177183
go w.serve(domain, token, keyAuth)
178184
return nil

0 commit comments

Comments
 (0)