diff --git a/code/rest/preference_controller.go b/code/rest/preference_controller.go index 942ddf2..bec1197 100644 --- a/code/rest/preference_controller.go +++ b/code/rest/preference_controller.go @@ -51,6 +51,7 @@ func (this *PreferenceController) RegisterRoutes() map[string]func(writer http.R routeMap["/api/preference/edit"] = this.Wrap(this.Edit, USER_ROLE_ADMINISTRATOR) routeMap["/api/preference/edit/preview/config"] = this.Wrap(this.EditPreviewConfig, USER_ROLE_ADMINISTRATOR) routeMap["/api/preference/edit/scan/config"] = this.Wrap(this.EditScanConfig, USER_ROLE_ADMINISTRATOR) + routeMap["/api/preference/scan/once"] = this.Wrap(this.ScanOnce, USER_ROLE_ADMINISTRATOR) routeMap["/api/preference/system/cleanup"] = this.Wrap(this.SystemCleanup, USER_ROLE_ADMINISTRATOR) return routeMap @@ -207,6 +208,13 @@ func (this *PreferenceController) EditScanConfig(writer http.ResponseWriter, req return this.Success(preference) } +//scan immediately according the current config. +func (this *PreferenceController) ScanOnce(writer http.ResponseWriter, request *http.Request) *result.WebResult { + + this.taskService.doScanTask() + return this.Success("OK") +} + //cleanup system data. func (this *PreferenceController) SystemCleanup(writer http.ResponseWriter, request *http.Request) *result.WebResult {