chore: update prettier configuration for print width (#519)
* feat: update prettier configuration for print width * chore: apply code formatting to entire repository * fix: remove build files * fix: format issue --------- Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
This commit is contained in:
@@ -6,10 +6,7 @@ interface CreateCronJobOptions {
|
||||
runOnStart?: boolean;
|
||||
}
|
||||
|
||||
export const createCronJob = (
|
||||
cronExpression: string,
|
||||
options: CreateCronJobOptions = { runOnStart: false },
|
||||
) => {
|
||||
export const createCronJob = (cronExpression: string, options: CreateCronJobOptions = { runOnStart: false }) => {
|
||||
return {
|
||||
withCallback: (callback: () => MaybePromise<void>) => {
|
||||
if (options.runOnStart) {
|
||||
|
||||
@@ -3,10 +3,7 @@ import { objectEntries } from "@homarr/common";
|
||||
import type { createCronJob } from "./creator";
|
||||
import { jobRegistry } from "./registry";
|
||||
|
||||
type Jobs = Record<
|
||||
string,
|
||||
ReturnType<ReturnType<typeof createCronJob>["withCallback"]>
|
||||
>;
|
||||
type Jobs = Record<string, ReturnType<ReturnType<typeof createCronJob>["withCallback"]>>;
|
||||
|
||||
export const createJobGroup = <TJobs extends Jobs>(jobs: TJobs) => {
|
||||
for (const [name, job] of objectEntries(jobs)) {
|
||||
|
||||
@@ -11,10 +11,7 @@ interface Queue<TInput extends z.ZodType = z.ZodType> {
|
||||
inputValidator: TInput;
|
||||
}
|
||||
|
||||
type Queues = Record<
|
||||
string,
|
||||
ReturnType<ReturnType<typeof createQueue>["withCallback"]>
|
||||
>;
|
||||
type Queues = Record<string, ReturnType<ReturnType<typeof createQueue>["withCallback"]>>;
|
||||
|
||||
export const createQueueClient = <TQueues extends Queues>(queues: TQueues) => {
|
||||
const queueRegistry = new Map<string, Queue>();
|
||||
@@ -31,10 +28,7 @@ export const createQueueClient = <TQueues extends Queues>(queues: TQueues) => {
|
||||
queueRegistry,
|
||||
client: objectKeys(queues).reduce(
|
||||
(acc, name) => {
|
||||
acc[name] = async (
|
||||
data: z.infer<TQueues[typeof name]["_input"]>,
|
||||
options,
|
||||
) => {
|
||||
acc[name] = async (data: z.infer<TQueues[typeof name]["_input"]>, options) => {
|
||||
if (typeof name !== "string") return;
|
||||
const queue = queueRegistry.get(name);
|
||||
if (!queue) return;
|
||||
@@ -42,10 +36,7 @@ export const createQueueClient = <TQueues extends Queues>(queues: TQueues) => {
|
||||
await queueChannel.addAsync({
|
||||
name,
|
||||
data,
|
||||
executionDate:
|
||||
typeof options === "object" && options.executionDate
|
||||
? options.executionDate
|
||||
: new Date(),
|
||||
executionDate: typeof options === "object" && options.executionDate ? options.executionDate : new Date(),
|
||||
});
|
||||
};
|
||||
return acc;
|
||||
|
||||
Reference in New Issue
Block a user