Skip to content

Commit

Permalink
fix and optimization for delta updates
Browse files Browse the repository at this point in the history
  • Loading branch information
MatejLach committed Jun 29, 2024
1 parent 8478397 commit bf93381
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/dynafire/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"log/slog"
"os"
"sync"
"time"

"github.com/MatejLach/dynafire/firewall/firewalld"
"github.com/MatejLach/dynafire/provider/turris"
Expand Down Expand Up @@ -91,6 +92,7 @@ func main() {

slog.Debug("whitelisting", "IP", deltaMsg.IP.String())
}
time.Sleep(250 * time.Millisecond)
<-sem
}
}()
Expand Down
1 change: 1 addition & 0 deletions provider/turris/turris.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ func (c *Client) RequestMessages(ctx context.Context) {
if !serialOk(previousDeltaSerial, dRes.Serial) {
refreshList = true
previousDeltaSerial = 0
continue
}

previousDeltaSerial = dRes.Serial
Expand Down

0 comments on commit bf93381

Please sign in to comment.