Commit 7980dc44 authored by David Venhoek's avatar David Venhoek
Browse files

Added irmago modifications for forced updates.

parent ec3366e7
......@@ -18,6 +18,7 @@ type SchemeManager struct {
URL string `xml:"Url"`
Contact string `xml:"contact"`
Description TranslatedString
MinimumAppVersion SchemeAppVersion
KeyshareServer string
KeyshareWebsite string
KeyshareAttribute string
......@@ -32,6 +33,11 @@ type SchemeManager struct {
index SchemeManagerIndex
}
type SchemeAppVersion struct {
Android int `xml:"Android"`
IOS int `xml:"iOS"`
}
// Issuer describes an issuer.
type Issuer struct {
ID string `xml:"ID"`
......
......@@ -1244,14 +1244,14 @@ func (conf *Configuration) UpdateSchemeManager(id SchemeManagerIdentifier, downl
return
}
func (conf *Configuration) updateSchemes() error {
func (conf *Configuration) UpdateSchemes() error {
for id := range conf.SchemeManagers {
Logger.WithField("scheme", id).Info("Auto-updating scheme")
if err := conf.UpdateSchemeManager(id, nil); err != nil {
return err
}
}
return nil
return conf.ParseFolder()
}
func (conf *Configuration) AutoUpdateSchemes(interval uint) {
......@@ -1259,7 +1259,7 @@ func (conf *Configuration) AutoUpdateSchemes(interval uint) {
conf.scheduler = gocron.NewScheduler()
conf.scheduler.Every(uint64(interval)).Minutes().Do(func() {
if err := conf.updateSchemes(); err != nil {
if err := conf.UpdateSchemes(); err != nil {
Logger.Error("Scheme autoupdater failed: ")
if e, ok := err.(*errors.Error); ok {
Logger.Error(e.ErrorStack())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment