mirror of
https://github.com/usual2970/certimate.git
synced 2025-10-05 05:54:53 +00:00
added some optimizations
This commit is contained in:
@@ -14,10 +14,12 @@ func create(ctx context.Context, record *models.Record) error {
|
||||
}
|
||||
|
||||
if record.GetBool("rightnow") {
|
||||
go func() {
|
||||
if err := deploy(ctx, record); err != nil {
|
||||
app.GetApp().Logger().Error("deploy failed", "err", err)
|
||||
}
|
||||
}()
|
||||
|
||||
if err := deploy(ctx, record); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
scheduler := app.GetScheduler()
|
||||
@@ -45,9 +47,11 @@ func update(ctx context.Context, record *models.Record) error {
|
||||
|
||||
if record.GetBool("rightnow") {
|
||||
|
||||
if err := deploy(ctx, record); err != nil {
|
||||
return err
|
||||
}
|
||||
go func() {
|
||||
if err := deploy(ctx, record); err != nil {
|
||||
app.GetApp().Logger().Error("deploy failed", "err", err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
err := scheduler.Add(record.Id, record.GetString("crontab"), func() {
|
||||
|
Reference in New Issue
Block a user