From f2522b980cc46ae1740fa84ba1abeb44ee16a6bd Mon Sep 17 00:00:00 2001 From: Qiu Jian Date: Fri, 23 Nov 2018 09:48:50 +0800 Subject: [PATCH 1/2] 1. resize opslog notes to VARCHAR(2048) 2. cloudaccount sync status check --- pkg/cloudcommon/db/opslog.go | 2 +- pkg/compute/models/cloudaccounts.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cloudcommon/db/opslog.go b/pkg/cloudcommon/db/opslog.go index cae57239f9..acc19deefe 100644 --- a/pkg/cloudcommon/db/opslog.go +++ b/pkg/cloudcommon/db/opslog.go @@ -153,7 +153,7 @@ type SOpsLog struct { ObjId string `width:"128" charset:"ascii" nullable:"false" list:"user"` // = Column(VARCHAR(ID_LENGTH, charset='ascii'), nullable=False) ObjName string `width:"128" charset:"utf8" nullable:"false" list:"user"` //= Column(VARCHAR(128, charset='utf8'), nullable=False) Action string `width:"32" charset:"ascii" nullable:"false" list:"user"` //= Column(VARCHAR(32, charset='ascii'), nullable=False) - Notes string `width:"1024" charset:"utf8" list:"user"` // = Column(VARCHAR(1024, charset='utf8')) + Notes string `width:"2048" charset:"utf8" list:"user"` // = Column(VARCHAR(1024, charset='utf8')) ProjectId string `name:"tenant_id" width:"128" charset:"ascii" list:"user"` // = Column(VARCHAR(ID_LENGTH, charset='ascii')) Project string `name:"tenant" width:"128" charset:"utf8" list:"user"` // tenant = Column(VARCHAR(128, charset='utf8')) UserId string `width:"128" charset:"ascii" list:"user"` // = Column(VARCHAR(ID_LENGTH, charset='ascii')) diff --git a/pkg/compute/models/cloudaccounts.go b/pkg/compute/models/cloudaccounts.go index 8dea136422..1713f5495c 100644 --- a/pkg/compute/models/cloudaccounts.go +++ b/pkg/compute/models/cloudaccounts.go @@ -187,7 +187,7 @@ func (self *SCloudaccount) getPassword() (string, error) { } func (self *SCloudaccount) CanSync() bool { - if self.Status == CLOUD_PROVIDER_SYNCING { + if self.Status == CLOUD_PROVIDER_SYNCING || self.Status == CLOUD_PROVIDER_START_SYNC { if self.LastSync.IsZero() || time.Now().Sub(self.LastSync) > 900*time.Second { return true } else { From 46b67e9dc97834baae30515e55170311d13450a6 Mon Sep 17 00:00:00 2001 From: Qiu Jian Date: Fri, 23 Nov 2018 15:03:22 +0800 Subject: [PATCH 2/2] minor updates --- pkg/cloudcommon/db/opslog.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cloudcommon/db/opslog.go b/pkg/cloudcommon/db/opslog.go index acc19deefe..35ef9c13e2 100644 --- a/pkg/cloudcommon/db/opslog.go +++ b/pkg/cloudcommon/db/opslog.go @@ -153,7 +153,7 @@ type SOpsLog struct { ObjId string `width:"128" charset:"ascii" nullable:"false" list:"user"` // = Column(VARCHAR(ID_LENGTH, charset='ascii'), nullable=False) ObjName string `width:"128" charset:"utf8" nullable:"false" list:"user"` //= Column(VARCHAR(128, charset='utf8'), nullable=False) Action string `width:"32" charset:"ascii" nullable:"false" list:"user"` //= Column(VARCHAR(32, charset='ascii'), nullable=False) - Notes string `width:"2048" charset:"utf8" list:"user"` // = Column(VARCHAR(1024, charset='utf8')) + Notes string `width:"2048" charset:"utf8" list:"user"` // = Column(VARCHAR(2048, charset='utf8')) ProjectId string `name:"tenant_id" width:"128" charset:"ascii" list:"user"` // = Column(VARCHAR(ID_LENGTH, charset='ascii')) Project string `name:"tenant" width:"128" charset:"utf8" list:"user"` // tenant = Column(VARCHAR(128, charset='utf8')) UserId string `width:"128" charset:"ascii" list:"user"` // = Column(VARCHAR(ID_LENGTH, charset='ascii'))