增加日志

This commit is contained in:
Sydonian 2024-05-20 14:29:44 +08:00
parent bebd19de50
commit 5b9d8ee02e
2 changed files with 4 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import (
"sync"
"time"
"gitlink.org.cn/cloudream/common/pkgs/logger"
schsdk "gitlink.org.cn/cloudream/common/sdks/scheduler"
cdssdk "gitlink.org.cn/cloudream/common/sdks/storage"
schglb "gitlink.org.cn/cloudream/scheduler/common/globals"
@ -63,6 +64,8 @@ func (s *Adjusting) do(rtx jobmgr.JobStateRunContext, jo *jobmgr.Job) error {
}
s.targetCCInfo = ccInfo
logger.WithField("JobID", jo.JobID).Infof("job is scheduled to %v(%v)", ccInfo.Name, ccInfo.CCID)
stgCli, err := schglb.CloudreamStoragePool.Acquire()
if err != nil {
return fmt.Errorf("new cds client: %w", err)

View File

@ -76,7 +76,7 @@ func (m *Manager) ChangeState(job *Job, state JobState) {
mgrJob.state = state
go func() {
logger.Infof("job %v state changed: %T -> %T", job.JobID, lastState, state)
logger.WithField("JobID", job.JobID).Infof("state changed: %T -> %T", lastState, state)
state.Run(JobStateRunContext{
Mgr: m,