webapi: Move search jobs into API context

This commit is contained in:
Kleissner
2021-12-29 05:47:17 +01:00
parent ec1bfdfac8
commit 5d598c13f6
3 changed files with 18 additions and 16 deletions

View File

@@ -29,6 +29,10 @@ type WebapiInstance struct {
Router *mux.Router
AllowKeyInParam []string // List of paths that accept the API key as &k= parameter
// search jobs
allJobs map[uuid.UUID]*SearchJob
allJobsMutex sync.RWMutex
// download info
downloads map[uuid.UUID]*downloadInfo
downloadsMutex sync.RWMutex
@@ -56,6 +60,7 @@ func Start(Backend *core.Backend, ListenAddresses []string, UseSSL bool, Certifi
backend: Backend,
Router: mux.NewRouter(),
AllowKeyInParam: []string{"/file/read", "/file/view"},
allJobs: make(map[uuid.UUID]*SearchJob),
downloads: make(map[uuid.UUID]*downloadInfo),
}