Skip to content

Commit

Permalink
Fix expiry times
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaavi committed Aug 4, 2023
1 parent b645e44 commit cbb4a0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func authorizeApp(ar *api.Request) (interface{}, error) {
Title: "An app requests access to the Portmaster",
Message: "Allow " + appName + " (" + proc.Profile().LocalProfile().Name + ") to query and modify the Portmaster?\n\nBinary: " + proc.Path,
ShowOnSystem: true,
Expires: time.Now().Add(time.Minute).UnixNano(),
Expires: time.Now().Add(time.Minute).Unix(),
AvailableActions: []*notifications.Action{
{
ID: "allow",
Expand Down
3 changes: 2 additions & 1 deletion resolver/ipinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"strings"
"sync"
"time"

"github.com/safing/portbase/database"
"github.com/safing/portbase/database/record"
Expand Down Expand Up @@ -170,7 +171,7 @@ func (info *IPInfo) Save() error {
}

// Calculate and set cache expiry.
var expires int64 = 86400 // Minimum TTL of one day.
expires := time.Now().Unix() + 86400 // Minimum TTL of one day.
for _, rd := range info.ResolvedDomains {
if rd.Expires > expires {
expires = rd.Expires
Expand Down

0 comments on commit cbb4a0f

Please sign in to comment.