worker

package
v0.0.0-...-2da20e2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package worker provides a background job scheduler for running periodic maintenance tasks. Jobs are registered at startup and run according to their defined schedules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(ctx context.Context) error

Start initializes and starts the background worker scheduler. It sets up the database connection, tracer, and registers all defined jobs. The scheduler runs until the provided context is canceled.

Types

type Job

type Job interface {
	// Name returns the unique name of the job.
	Name() string

	// Schedule defines when the job should run.
	Schedule() gocron.JobDefinition

	// Do executes the job's task.
	Do(ctx context.Context, s *service.Service, db *app.DB) error
}

Job defines the interface for a background worker job. Each job must provide a name, a schedule, and an execution function.

Directories

Path Synopsis
Package cleanupchangeemailrequests ...
Package cleanupchangeemailrequests ...
Package cleanupdeletedbooks provides a worker job for permanently removing soft-deleted books from the database after a retention period defined by ds.CleanupDeletedEntitiesAfterDays.
Package cleanupdeletedbooks provides a worker job for permanently removing soft-deleted books from the database after a retention period defined by ds.CleanupDeletedEntitiesAfterDays.
Package cleanupdeletedusers ...
Package cleanupdeletedusers ...
Package cleanupexpiredpasswordchangerequests ...
Package cleanupexpiredpasswordchangerequests ...
Package cleanupexpiredusersessions ...
Package cleanupexpiredusersessions ...
Package cleanupfiles ...
Package cleanupfiles ...
Package deletetempfiles ...
Package deletetempfiles ...
Package deleteunconfirmedusers ...
Package deleteunconfirmedusers ...

Jump to

Keyboard shortcuts

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