save the asp new time

This commit is contained in:
Radu Ioan Fericean
2012-07-25 14:44:37 +03:00
parent 50d7d15c8c
commit b2fb02b925
10 changed files with 39 additions and 180 deletions

View File

@@ -69,9 +69,16 @@ func loadActionTimings(storage timespans.StorageGetter) {
}
// recreate the queue
s.queue = timespans.ActionTimingPriotityList{}
for _, at := range actionTimings {
at.CheckForASAP()
s.queue = append(s.queue, at)
for key, ats := range actionTimings {
toBeSaved := false
for _, at := range ats {
asapFound := at.CheckForASAP()
toBeSaved = toBeSaved || asapFound
s.queue = append(s.queue, at)
}
if toBeSaved {
storage.SetActionTimings(key, ats)
}
}
sort.Sort(s.queue)
}