mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-08-30 17:13:08 +08:00
- fix image status on upload failed
- fix init nbd
This commit is contained in:
@@ -370,7 +370,7 @@ func (self *SImage) saveSuccess(userCred mcclient.TokenCredential, msg string) {
|
||||
|
||||
func (self *SImage) saveFailed(userCred mcclient.TokenCredential, msg string) {
|
||||
log.Errorf(msg)
|
||||
self.SetStatus(userCred, api.IMAGE_STATUS_QUEUED, msg)
|
||||
self.SetStatus(userCred, api.IMAGE_STATUS_KILLED, msg)
|
||||
db.OpsLog.LogEvent(self, db.ACT_SAVE_FAIL, msg, userCred)
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/cronman"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/db"
|
||||
common_options "yunion.io/x/onecloud/pkg/cloudcommon/options"
|
||||
"yunion.io/x/onecloud/pkg/hostman/storageman/nbd"
|
||||
"yunion.io/x/onecloud/pkg/image/models"
|
||||
"yunion.io/x/onecloud/pkg/image/options"
|
||||
_ "yunion.io/x/onecloud/pkg/image/tasks"
|
||||
@@ -103,6 +104,8 @@ func StartService() {
|
||||
|
||||
go models.CheckImages()
|
||||
|
||||
nbd.Init() // init nbd module for image probe
|
||||
|
||||
cron := cronman.GetCronJobManager(true)
|
||||
cron.AddJob1("CleanPendingDeleteImages", time.Duration(options.Options.PendingDeleteCheckSeconds)*time.Second, models.ImageManager.CleanPendingDeleteImages)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user