howdy/jobs/cli
Command-line management of an app’s jobs, for servers without the admin. Give it a way to open the app’s database, in a task module:
// src/tasks/jobs.gleam
import howdy/jobs/cli
pub fn main() -> Nil {
cli.main(fn() { my_app.database() })
}
gleam run -m tasks/jobs stats
gleam run -m tasks/jobs retry --failed --job welcome_email
In a release built with gleam export erlang-shipment, run it from the
release directory, with the arguments after -extra:
erl -pa */ebin -noshell -eval 'tasks@jobs:main()' -extra stats
Changes go straight to the database, and running nodes see them the next time they look for jobs.
Types
Values
pub fn main(
open: fn() -> Result(repo.Repo, service.Error),
) -> Nil
Run the command the process was started with, print what it says, and exit with its status.
pub fn run(
open: fn() -> Result(repo.Repo, service.Error),
arguments: List(String),
) -> Outcome
Run one command without printing or exiting.