M environment.go => environment.go +0 -30
@@ 204,20 204,6 @@ func (env *Environment) jobHttp(id string) (job *JobHttp) {
return nil
}
-func (env *Environment) jobsLock() {
- var job *Job
- for _, job = range env.Jobs {
- job.Lock()
- }
-}
-
-func (env *Environment) jobsUnlock() {
- var job *Job
- for _, job = range env.Jobs {
- job.Unlock()
- }
-}
-
func (env *Environment) init() (err error) {
var (
logp = `init`
@@ 325,14 311,6 @@ func (env *Environment) initDirs() (err error) {
return nil
}
-// httpJobsLock lock all the jobs.
-func (env *Environment) httpJobsLock() {
- var jobHttp *JobHttp
- for _, jobHttp = range env.HttpJobs {
- jobHttp.Lock()
- }
-}
-
func (env *Environment) httpJobsSave() (err error) {
var jobHttp *JobHttp
for _, jobHttp = range env.HttpJobs {
@@ 344,14 322,6 @@ func (env *Environment) httpJobsSave() (err error) {
return nil
}
-// httpJobsUnlock unlock all the jobs.
-func (env *Environment) httpJobsUnlock() {
- var jobHttp *JobHttp
- for _, jobHttp = range env.HttpJobs {
- jobHttp.Unlock()
- }
-}
-
// loadConfigJob load jobs configuration from file.
func (env *Environment) loadConfigJob(conf string) (jobs map[string]*Job, err error) {
type jobContainer struct {
M karajo.go => karajo.go +0 -5
@@ 329,12 329,7 @@ func (k *Karajo) apiEnvironment(epr *libhttp.EndpointRequest) (resbody []byte, e
res.Code = http.StatusOK
res.Data = k.env
- k.env.jobsLock()
- k.env.httpJobsLock()
resbody, err = json.Marshal(res)
- k.env.httpJobsUnlock()
- k.env.jobsUnlock()
-
if err != nil {
return nil, fmt.Errorf(`%s: %w`, logp, err)
}