mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
refactor: update setting routes and enhance dependency management
- Changed route parameter from ':id' to ':key' in settings-related routes for better clarity and consistency. - Updated GetSetting, PostSetting, and PutSetting functions to use the new ':key' parameter. - Introduced IsAutoInstallEnabled method in DependencyInstallerService to check auto-installation status. - Enhanced the task runner to check if auto installation is enabled before proceeding with dependency installation. - Improved initialization of settings data in the system service, ensuring proper insertion of initial settings.
This commit is contained in:
@@ -1044,12 +1044,20 @@ func (r *Runner) installDependenciesIfAvailable() (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Get dependency installer service
|
||||
depSvc := dependency.GetDependencyInstallerRegistryService()
|
||||
if depSvc == nil {
|
||||
r.Warnf("dependency installer service not available")
|
||||
return nil
|
||||
}
|
||||
|
||||
// Check if auto install is enabled
|
||||
if !depSvc.IsAutoInstallEnabled() {
|
||||
r.Debug("auto dependency installation is disabled")
|
||||
return nil
|
||||
}
|
||||
|
||||
// Get install command
|
||||
cmd, err := depSvc.GetInstallDependencyRequirementsCmdBySpiderId(r.s.Id)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user