fix: handle "every" when defined inside of flux (#460)
This commit is contained in:
parent
11859bdaf6
commit
ac1eb0b620
@ -93,11 +93,16 @@ func (c Client) Create(ctx context.Context, params *CreateParams) error {
|
||||
OrgID: org.IDOrNil(),
|
||||
Org: org.NameOrNil(),
|
||||
Name: ¶ms.Name,
|
||||
Every: ¶ms.Every,
|
||||
Cron: ¶ms.Cron,
|
||||
ScriptID: scriptID,
|
||||
ScriptParameters: scriptParams,
|
||||
}
|
||||
|
||||
// The FluxQuery can also contain the "every" field, so we only want to override if it is actually defined.
|
||||
if params.Every != "" {
|
||||
createRequest.Every = ¶ms.Every
|
||||
}
|
||||
|
||||
task, err := c.PostTasks(ctx).TaskCreateRequest(createRequest).Execute()
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
x
Reference in New Issue
Block a user