refactor ITableSpec signature with context

This commit is contained in:
Zexi Li
2020-06-08 11:31:00 +08:00
parent 95a58cc606
commit 9f4d4a450e
140 changed files with 290 additions and 273 deletions
+1 -1
View File
@@ -162,7 +162,7 @@ func (joint *SAlertnotification) GetExtraDetails(
}
func (joint *SAlertnotification) DoSave(ctx context.Context, userCred mcclient.TokenCredential) error {
if err := AlertNotificationManager.TableSpec().Insert(joint); err != nil {
if err := AlertNotificationManager.TableSpec().Insert(ctx, joint); err != nil {
return err
}
joint.SetModelManager(AlertNotificationManager, joint)
+1 -1
View File
@@ -109,7 +109,7 @@ func (man *SDataSourceManager) initDefaultDataSource(ctx context.Context) error
Url: url,
}
ds.Name = DefaultDataSource
if err := man.TableSpec().Insert(ds); err != nil {
if err := man.TableSpec().Insert(ctx, ds); err != nil {
log.Errorf("insert default influxdb: %v", err)
}
}