Skip to content

Commit 214d7be

Browse files
committed
Remove unneeded create project job
1 parent f2d02eb commit 214d7be

7 files changed

Lines changed: 3 additions & 46 deletions

File tree

src/lib/server/bullmq/BullMQ.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export const allWorkers = building
66
: [
77
new Workers.Builds(),
88
new Workers.S3(),
9-
new Workers.Projects(),
109
new Workers.Releases(),
1110
new Workers.Polling(),
1211
new Workers.SystemStartup()

src/lib/server/bullmq/BullWorker.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,18 +136,6 @@ export class S3<J extends BullMQ.S3Job> extends BullWorker<J> {
136136
}
137137
}
138138

139-
export class Projects<J extends BullMQ.ProjectJob> extends BullWorker<J> {
140-
constructor() {
141-
super(BullMQ.QueueName.Projects);
142-
}
143-
async run(job: Job<J>) {
144-
switch (job.data.type) {
145-
case BullMQ.JobType.Project_Create:
146-
return Executor.Project.create(job as Job<BullMQ.Project.Create>);
147-
}
148-
}
149-
}
150-
151139
export class Releases<J extends BullMQ.PublishJob> extends BullWorker<J> {
152140
constructor() {
153141
super(BullMQ.QueueName.Releases);

src/lib/server/bullmq/queues.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
import { Queue } from 'bullmq';
22
import { BullMQOtel } from 'bullmq-otel';
33
import { Redis } from 'ioredis';
4-
import type {
5-
BuildJob,
6-
PollJob,
7-
ProjectJob,
8-
PublishJob,
9-
RecurringJob,
10-
S3Job,
11-
StartupJob
12-
} from './types';
4+
import type { BuildJob, PollJob, PublishJob, RecurringJob, S3Job, StartupJob } from './types';
135
import { QueueName } from './types';
146
import { env } from '$env/dynamic/private';
157
import OTEL from '$lib/otel';
@@ -129,8 +121,6 @@ function createQueues() {
129121
const Builds = new Queue<BuildJob>(QueueName.Builds, getQueueConfig());
130122
/** Queue for S3 jobs */
131123
const S3 = new Queue<S3Job>(QueueName.S3, getQueueConfig());
132-
/** Queue for miscellaneous jobs in BuildEngine such as Product and Project Creation */
133-
const Projects = new Queue<ProjectJob>(QueueName.Projects, getQueueConfig());
134124
/** Queue for Product Publishing */
135125
const Releases = new Queue<PublishJob>(QueueName.Releases, getQueueConfig());
136126
/** Queue for jobs that poll BuildEngine, such as checking the status of a build */
@@ -142,7 +132,6 @@ function createQueues() {
142132
return {
143133
Builds,
144134
S3,
145-
Projects,
146135
Releases,
147136
Polling,
148137
SystemStartup,

src/lib/server/bullmq/types.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export const RepeatEveryMinute: RepeatOptions = {
1919
export enum QueueName {
2020
Builds = 'Builds',
2121
S3 = 'S3',
22-
Projects = 'Projects',
2322
Releases = 'Releases',
2423
Polling = 'Polling',
2524
System_Startup = 'System (Startup)',
@@ -33,8 +32,6 @@ export enum JobType {
3332
// Polling Jobs
3433
Poll_Build = 'Check Product Build',
3534
Poll_Release = 'Check Product Release',
36-
// Project Jobs
37-
Project_Create = 'Create Project',
3835
// Publishing Jobs
3936
Release_Product = 'Release Product',
4037
Release_Cancel = 'Cancel Release',
@@ -75,13 +72,6 @@ export namespace Polling {
7572
}
7673
}
7774

78-
export namespace Project {
79-
export interface Create {
80-
type: JobType.Project_Create;
81-
projectId: number;
82-
}
83-
}
84-
8575
export namespace Release {
8676
export interface Product {
8777
type: JobType.Release_Product;
@@ -123,7 +113,6 @@ export type BuildJob = JobTypeMap[JobType.Build_Product | JobType.Build_Cancel];
123113
export type S3Job = JobTypeMap[JobType.S3_CopyArtifacts | JobType.S3_CopyError];
124114
export type PublishJob = JobTypeMap[JobType.Release_Product | JobType.Release_Cancel];
125115
export type PollJob = JobTypeMap[JobType.Poll_Build | JobType.Poll_Release];
126-
export type ProjectJob = JobTypeMap[JobType.Project_Create];
127116
export type StartupJob = JobTypeMap[
128117
| JobType.System_CreateCodeBuildProject
129118
| JobType.System_RefreshAppVersions];
@@ -134,7 +123,6 @@ export type JobTypeMap = {
134123
[JobType.Build_Cancel]: Build.Cancel;
135124
[JobType.Poll_Build]: Polling.Build;
136125
[JobType.Poll_Release]: Polling.Release;
137-
[JobType.Project_Create]: Project.Create;
138126
[JobType.Release_Product]: Release.Product;
139127
[JobType.Release_Cancel]: Release.Cancel;
140128
[JobType.S3_CopyArtifacts]: S3.CopyArtifacts;
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export * as Build from './build';
22
export * as Polling from './polling';
3-
export * as Project from './project';
43
export * as Release from './release';
54
export * as S3 from './s3';
65
export * as System from './system';

src/lib/server/job-executors/project.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/routes/(api)/project/+server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const projectSchema = v.strictObject({
2525
export const POST: RequestHandler = async ({ request, locals }) => {
2626
const parsed = v.safeParse(projectSchema, await request.json());
2727
if (!parsed.success) return ErrorResponse(400, JSON.stringify(v.flatten(parsed.issues)));
28-
// TODO enqueue project creation job
28+
2929
const withoutStorage = { ...parsed.output, storage_type: undefined };
3030
const project = await prisma.project.create({
3131
data: {
@@ -54,7 +54,7 @@ export const POST: RequestHandler = async ({ request, locals }) => {
5454
})
5555
);
5656
};
57-
// TODO create bucket???
57+
5858
function getS3Folder(
5959
project: Prisma.projectGetPayload<{
6060
select: {

0 commit comments

Comments
 (0)