Add logging to core update notification

This commit is contained in:
Patrick Pacher 2020-05-04 14:32:46 +02:00
parent 19ec8bf428
commit c65cadb06f
No known key found for this signature in database
GPG key ID: E8CD2DA160925A6D

View file

@ -73,7 +73,7 @@ func upgradeCoreNotify() error {
// check if we can upgrade // check if we can upgrade
if pmCoreUpdate == nil || pmCoreUpdate.UpgradeAvailable() { if pmCoreUpdate == nil || pmCoreUpdate.UpgradeAvailable() {
// get newest portmaster-control // get newest portmaster-core
new, err := GetPlatformFile(identifier) new, err := GetPlatformFile(identifier)
if err != nil { if err != nil {
return err return err
@ -84,12 +84,12 @@ func upgradeCoreNotify() error {
} }
if info.GetInfo().Version != pmCoreUpdate.Version() { if info.GetInfo().Version != pmCoreUpdate.Version() {
// create notification notifications.NotifyInfo(
(&notifications.Notification{ "updates-core-update-available",
ID: "updates-core-update-available", fmt.Sprintf("There is an update available for the Portmaster core (v%s), please restart the Portmaster to apply the update.", pmCoreUpdate.Version()),
Message: fmt.Sprintf("There is an update available for the Portmaster core (v%s), please restart the Portmaster to apply the update.", pmCoreUpdate.Version()), )
Type: notifications.Info,
}).Save() log.Debugf("updates: new portmaster version available, sending notification to user")
} }
return nil return nil