Skip to content

Commit

Permalink
feat: worker script
Browse files Browse the repository at this point in the history
  • Loading branch information
nyet-ty committed Feb 5, 2024
1 parent c877a7f commit db1f930
Show file tree
Hide file tree
Showing 13 changed files with 292 additions and 116 deletions.
167 changes: 74 additions & 93 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@sentry/nextjs": "7.94.1",
"@tanstack/react-query": "4.29.13",
"@tanstack/react-query-devtools": "4.29.13",
"@taskany/bricks": "5.0.1",
"@taskany/bricks": "5.7.0",
"@taskany/colors": "1.8.0",
"@taskany/icons": "2.0.1",
"@trpc/client": "10.1.0",
Expand Down
18 changes: 18 additions & 0 deletions prisma/migrations/20240202101116_jobs/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- CreateTable
CREATE TABLE "Job" (
"id" TEXT NOT NULL,
"state" TEXT NOT NULL,
"priority" INTEGER NOT NULL DEFAULT 0,
"kind" TEXT NOT NULL,
"data" JSONB NOT NULL,
"delay" INTEGER,
"retry" INTEGER,
"runs" INTEGER NOT NULL DEFAULT 0,
"force" BOOLEAN NOT NULL DEFAULT false,
"cron" TEXT,
"error" TEXT,
"createdAt" TIMESTAMP NOT NULL DEFAULT timezone('utc'::text, now()),
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT timezone('utc'::text, now()),

CONSTRAINT "Job_pkey" PRIMARY KEY ("id")
);
17 changes: 17 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -429,3 +429,20 @@ model UserSettings {
theme String @default("system")
}

model Job {
id String @id @default(cuid())
state String
priority Int @default(0)
kind String
data Json
delay Int?
retry Int?
runs Int @default(0)
force Boolean @default(false)
cron String?
error String?
createdAt DateTime @default(dbgenerated("timezone('utc'::text, now())")) @db.Timestamp()
updatedAt DateTime @default(dbgenerated("timezone('utc'::text, now())")) @updatedAt
}
Loading

0 comments on commit db1f930

Please sign in to comment.