Add MariaDB queue table. Fix Bugs
This commit is contained in:
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
import type { BunMariaDBConfig, DBResponseObject } from "../../types";
|
||||
type Params<Table extends string = string> = {
|
||||
table: Table;
|
||||
id: number | string;
|
||||
/** `queue_lock_token` from the claimed row */
|
||||
lock_token: string;
|
||||
error?: string;
|
||||
/** Wait this long before the job can be retried. Defaults to 0 */
|
||||
retry_delay_ms?: number;
|
||||
/** Mark the job `failed` instead of retrying once it reaches this many attempts. Defaults to the table's `max_attempts` */
|
||||
max_attempts?: number;
|
||||
config?: BunMariaDBConfig;
|
||||
};
|
||||
/**
|
||||
* Release a claimed job after a failed attempt. It goes back to `pending`
|
||||
* (after `retry_delay_ms`) or to `failed` once `max_attempts` is reached.
|
||||
*/
|
||||
export default function QueueFail<Table extends string = string>({ table, id, lock_token, error, retry_delay_ms, max_attempts, config, }: Params<Table>): Promise<DBResponseObject>;
|
||||
export {};
|
||||
Reference in New Issue
Block a user