cron

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Cmd = &cobra.Command{
		Use:           "cron",
		Short:         "Delete subscription cron job",
		SilenceUsage:  true,
		SilenceErrors: true,
		Run: func(_ *cobra.Command, _ []string) {
			var (
				c         func()
				e         error
				ctxAll    context.Context
				ctxCancel context.CancelFunc
				cron      *cron.Cron
			)
			defer func() {
				if c != nil {
					c()
				}
			}()
			cmd.Slave.Executor(func(ctx context.Context) error {
				initial, _ := entrypoint.CtxExtractInitial(ctx)
				ctxAll, ctxCancel = context.WithCancel(ctx)

				cron, c, e = daemon.BuildCron(ctxAll, initial, cmd.Observer)
				if e != nil {
					return e
				}
				return nil
			}, func(ctx context.Context) error {
				if err := cron.DeleteSubscriptions(ctxAll); err != nil {
					e = err
					ctxCancel()
				}
				return e
			})
		},
	}
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL