Fix resource index not updated. Minor module improvements

This commit is contained in:
Patrick Pacher
2020-04-14 14:02:05 +02:00
parent a6d768958d
commit fc9835f91a
5 changed files with 44 additions and 17 deletions

View File

@@ -157,9 +157,13 @@ func DisableUpdateSchedule() error {
}
func checkForUpdates(ctx context.Context) error {
if err := registry.UpdateIndexes(); err != nil {
return fmt.Errorf("updates: failed to update indexes: %w", err)
}
err := registry.DownloadUpdates(ctx)
if err != nil {
return fmt.Errorf("updates: failed to update: %s", err)
return fmt.Errorf("updates: failed to update: %w", err)
}
module.TriggerEvent(ResourceUpdateEvent, nil)
return nil