mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
16 lines
422 B
Go
16 lines
422 B
Go
package service
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/fleetdm/fleet/v4/server/fleet"
|
|
)
|
|
|
|
// TriggerCronSchedule attempts to trigger an ad-hoc run of the named cron schedule.
|
|
func (svc *Service) TriggerCronSchedule(ctx context.Context, name string) error {
|
|
if err := svc.authz.Authorize(ctx, &fleet.CronSchedules{}, fleet.ActionWrite); err != nil {
|
|
return err
|
|
}
|
|
return svc.cronSchedulesService.TriggerCronSchedule(name)
|
|
}
|