[WIP] New updater first working prototype
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
|
||||
"github.com/safing/portmaster/base/log"
|
||||
"github.com/safing/portmaster/service/mgr"
|
||||
"github.com/safing/portmaster/service/updates"
|
||||
)
|
||||
|
||||
// Event Names.
|
||||
@@ -105,4 +106,6 @@ func New(instance instance) (*NetEnv, error) {
|
||||
return module, nil
|
||||
}
|
||||
|
||||
type instance interface{}
|
||||
type instance interface {
|
||||
Updates() *updates.Updates
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ import (
|
||||
"github.com/safing/portmaster/base/notifications"
|
||||
"github.com/safing/portmaster/service/mgr"
|
||||
"github.com/safing/portmaster/service/network/netutils"
|
||||
"github.com/safing/portmaster/service/updates"
|
||||
)
|
||||
|
||||
// OnlineStatus represent a state of connectivity to the Internet.
|
||||
@@ -221,7 +220,7 @@ func updateOnlineStatus(status OnlineStatus, portalURL *url.URL, comment string)
|
||||
|
||||
// Trigger update check when coming (semi) online.
|
||||
if Online() {
|
||||
_ = updates.TriggerUpdate(false, false)
|
||||
module.instance.Updates().EventResourcesUpdated.Submit(struct{}{})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user