cronstore

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package cronstore persists the last-run time + outcome of each app's scheduled tasks, so the scheduler knows when a task is next due and a restart doesn't re-fire everything.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Run

type Run struct {
	LastRun int64
	LastOK  bool
}

Run is one task's last-run bookkeeping.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store records scheduled-task runs.

func New

func New(db *store.DB) *Store

New builds a Store.

func (*Store) DeleteApp

func (s *Store) DeleteApp(ctx context.Context, slug string) error

DeleteApp removes all scheduled-task rows for a slug (app teardown).

func (*Store) Get

func (s *Store) Get(ctx context.Context, slug, task string) (Run, error)

Get returns the last run for (slug, task); zero value (LastRun=0) if never run.

func (*Store) Record

func (s *Store) Record(ctx context.Context, slug, task string, at int64, ok bool) error

Record upserts the last-run time + outcome for a task.

Jump to

Keyboard shortcuts

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