implemented priority preloading
This commit is contained in:
parent
86bd1cd1e5
commit
eb6272e411
7 changed files with 134 additions and 107 deletions
|
|
@ -60,6 +60,7 @@ type file struct {
|
|||
URI template.HTML
|
||||
Anchor string
|
||||
Status int
|
||||
Prio int
|
||||
Running bool
|
||||
}
|
||||
|
||||
|
|
@ -136,12 +137,10 @@ func getPreloads(path string, fs *fs.FS) (dc dirContents) {
|
|||
Name: template.HTML(p.Name),
|
||||
URI: template.HTML(p.Name),
|
||||
Status: p.Status,
|
||||
Prio: p.Prio,
|
||||
Running: p.Running,
|
||||
})
|
||||
}
|
||||
slices.SortFunc(dc.Files, func(i, _ file) bool {
|
||||
return i.Running
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue