// EndJobQueue => acts like a kill switch to put down the jobs queue service (mostly the go routine that runs in the background)
EndJobQueue => acts like a kill switch to put down the jobs queue service (mostly the go routine that runs in the background)
// EndJobQueue = > acts like a kill switch to put down the jobs queue service ( mostly the go routine that runs in the background )
func (m Master) EndJobQueue() {
	m.done <- true
	for jobID, job := range m.jobs {
		if job.status == Running {
			job.channel <- true
		}
		job.completed = true
		job.status = Killed
		jobsMutex.Lock()
		jobs[jobID] = job
		jobsMutex.Unlock()
	}
	go func() {
		time.Sleep(10 * time.Second)
		m.jobs = map[string]JobRelatedData{}
	}()
}
func ( m Master ) EndJobQueue ( ) { m . done <- true for jobID , job := range m . jobs { if job . status == Running { job . channel <- true } job . completed = true job . status = Killed jobsMutex . Lock ( ) jobs [ jobID ] = job jobsMutex . Unlock ( ) } go func ( ) { time . Sleep ( 10 * time . Second ) m . jobs = map [ string ] JobRelatedData { } } ( ) }
EndJobQueue => acts like a kill switch to put down the jobs queue service (mostly the go routine that runs in the background)
EndJobQueue = > acts like a kill switch to put down the jobs queue service ( mostly the go routine that runs in the background )