proc/worker/agent.go
func (w *Worker) AgentPreServiceTerminate(job *data.Job) error {
	logger := w.logger.Add("method", "AgentPreServiceSuspend", "job", job)
	channel, err := w.agentUpdateServiceStatus(logger, job,
		data.JobAgentPreServiceTerminate)
	if err != nil {
		return err
	}

	if channel.ReceiptBalance == 0 {
		return nil
	}

	return w.agentCooperativeClose(logger, job, channel)
}
func (w *Worker) AgentPreServiceTerminate(job *data.Job) error {
	logger := w.logger.Add("method", "AgentPreServiceSuspend", "job", job)
	channel, err := w.agentUpdateServiceStatus(logger, job,
		data.JobAgentPreServiceTerminate)
	if err != nil {
		return err
	}

	if channel.ReceiptBalance == 0 {
		return nil
	}

	return w.agentCooperativeClose(logger, job, channel)
}
// AgentPreServiceTerminate terminates the service.