func (m *Manager) CancelJob(id int) {
	m.mutex.Lock()
	defer m.mutex.Unlock()

	_, j := m.getJob(m.queue, id)
	if j != nil {
		j.cancel()

		if j.Status == StatusCancelled {
			// remove from the queue
			m.removeJob(j)
		}
	}
}
// CancelJob cancels the job with the provided id. Jobs that have been started
// are notified that they are stopping. Jobs that have not yet started are
// removed from the queue. If no job exists with the provided id, then there is
// no effect. Likewise, if the job is already cancelled, there is no effect.
CancelJob cancels the job with the provided id. Jobs that have been started
are notified that they are stopping. Jobs that have not yet started are
removed from the queue. If no job exists with the provided id, then there is
no effect. Likewise, if the job is already cancelled, there is no effect.
// CancelJob cancels the job with the provided id . Jobs that have been started // are notified that they are stopping . Jobs that have not yet started are // removed from the queue . If no job exists with the provided id then there is // no effect . Likewise if the job is already cancelled there is no effect .
func (m *Manager) CancelJob(id int) {
	m.mutex.Lock()
	defer m.mutex.Unlock()
	_, j := m.getJob(m.queue, id)
	if j != nil {
		j.cancel()
		if j.Status == StatusCancelled {
			m.removeJob(j)
		}
	}
}
func ( m * Manager ) CancelJob ( id int ) { m . mutex . Lock ( ) defer m . mutex . Unlock ( ) _ , j := m . getJob ( m . queue , id ) if j != nil { j . cancel ( ) if j . Status == StatusCancelled { m . removeJob ( j ) } } }
CancelJob cancels the job with the provided id.
CancelJob cancels the job with the provided id .
// remove from the queue