Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Bulk job enqueuing #56

Closed
wants to merge 1 commit into from
Closed

[DRAFT] Bulk job enqueuing #56

wants to merge 1 commit into from

Conversation

wwwwhiterabbit
Copy link
Contributor

Before

-- Performing TestRunJob (Job ID: b4114bbc-b7a4-407a-8909-6fd625ce9077) from SolidQueue(default) with arguments: 9

SELECT "test_runs".* FROM "test_runs" WHERE "test_runs"."id" = $1 ORDER BY "test_runs"."id" DESC LIMIT $2;
SELECT "test_model_version_runs"."id" FROM "test_model_version_runs" WHERE "test_model_version_runs"."test_run_id" = $1 ORDER BY "test_model_version_runs"."id" DESC;

BEGIN;
INSERT INTO "solid_queue_jobs" ("queue_name", "class_name", "arguments", "priority", "active_job_id", "scheduled_at", "finished_at", "concurrency_key", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id";
SAVEPOINT active_record_1;
SELECT "solid_queue_jobs".* FROM "solid_queue_jobs" WHERE "solid_queue_jobs"."id" = $1 LIMIT $2;
INSERT INTO "solid_queue_ready_executions" ("job_id", "queue_name", "priority", "created_at") VALUES ($1, $2, $3, $4) RETURNING "id";
RELEASE SAVEPOINT active_record_1;
COMMIT;

-- Enqueued TestModelVersionRunJob (Job ID: aaaa36e1-2d9a-4bd0-9771-86d187f22157) to SolidQueue(default) with arguments: 8

BEGIN;
INSERT INTO "solid_queue_jobs" ("queue_name", "class_name", "arguments", "priority", "active_job_id", "scheduled_at", "finished_at", "concurrency_key", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id";
SAVEPOINT active_record_1;
SELECT "solid_queue_jobs".* FROM "solid_queue_jobs" WHERE "solid_queue_jobs"."id" = $1 LIMIT $2;
INSERT INTO "solid_queue_ready_executions" ("job_id", "queue_name", "priority", "created_at") VALUES ($1, $2, $3, $4) RETURNING "id";
RELEASE SAVEPOINT active_record_1;
COMMIT;

-- Enqueued TestModelVersionRunJob (Job ID: b44bb0dc-a62f-4ed9-a44b-5b99b5ebd5bb) to SolidQueue(default) with arguments: 8

BEGIN;
INSERT INTO "solid_queue_jobs" ("queue_name", "class_name", "arguments", "priority", "active_job_id", "scheduled_at", "finished_at", "concurrency_key", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id";
SAVEPOINT active_record_1;
SELECT "solid_queue_jobs".* FROM "solid_queue_jobs" WHERE "solid_queue_jobs"."id" = $1 LIMIT $2;
INSERT INTO "solid_queue_ready_executions" ("job_id", "queue_name", "priority", "created_at") VALUES ($1, $2, $3, $4) RETURNING "id";
RELEASE SAVEPOINT active_record_1;
COMMIT;

-- Enqueued TestModelVersionRunJob (Job ID: 384cfcb8-0b0e-49b2-8e45-c93671ec258c) to SolidQueue(default) with arguments: 8

BEGIN;
INSERT INTO "solid_queue_jobs" ("queue_name", "class_name", "arguments", "priority", "active_job_id", "scheduled_at", "finished_at", "concurrency_key", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id";
SAVEPOINT active_record_1;
SELECT "solid_queue_jobs".* FROM "solid_queue_jobs" WHERE "solid_queue_jobs"."id" = $1 LIMIT $2;
INSERT INTO "solid_queue_ready_executions" ("job_id", "queue_name", "priority", "created_at") VALUES ($1, $2, $3, $4) RETURNING "id";
RELEASE SAVEPOINT active_record_1;
COMMIT;

-- Enqueued TestModelVersionRunJob (Job ID: 66fbe87d-f802-4d63-bc38-d2bf292374f0) to SolidQueue(default) with arguments: 7

BEGIN;
INSERT INTO "solid_queue_jobs" ("queue_name", "class_name", "arguments", "priority", "active_job_id", "scheduled_at", "finished_at", "concurrency_key", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id";
SAVEPOINT active_record_1;
SELECT "solid_queue_jobs".* FROM "solid_queue_jobs" WHERE "solid_queue_jobs"."id" = $1 LIMIT $2;
INSERT INTO "solid_queue_ready_executions" ("job_id", "queue_name", "priority", "created_at") VALUES ($1, $2, $3, $4) RETURNING "id";
RELEASE SAVEPOINT active_record_1;
COMMIT;

-- Enqueued TestModelVersionRunJob (Job ID: 39cef773-c475-4e86-9d6d-47e579a95a3d) to SolidQueue(default) with arguments: 7

BEGIN;
INSERT INTO "solid_queue_jobs" ("queue_name", "class_name", "arguments", "priority", "active_job_id", "scheduled_at", "finished_at", "concurrency_key", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id";
SAVEPOINT active_record_1;
SELECT "solid_queue_jobs".* FROM "solid_queue_jobs" WHERE "solid_queue_jobs"."id" = $1 LIMIT $2;
INSERT INTO "solid_queue_ready_executions" ("job_id", "queue_name", "priority", "created_at") VALUES ($1, $2, $3, $4) RETURNING "id";
RELEASE SAVEPOINT active_record_1;
COMMIT;

-- Enqueued TestModelVersionRunJob (Job ID: 229c4e1c-a1c8-4366-bc53-6b510a4feb43) to SolidQueue(default) with arguments: 7

-- Performed TestRunJob (Job ID: b4114bbc-b7a4-407a-8909-6fd625ce9077) from SolidQueue(default) in 204.92ms

After

-- Performing TestRunJob (Job ID: 1dd62696-b7f7-49cc-b4e6-b72b466c1bb7) from SolidQueue(default) with arguments: 9

SELECT "test_runs".* FROM "test_runs" WHERE "test_runs"."id" = $1 ORDER BY "test_runs"."id" DESC LIMIT $2;
SELECT "test_model_version_runs"."id" FROM "test_model_version_runs" WHERE "test_model_version_runs"."test_run_id" = $1 ORDER BY "test_model_version_runs"."id" DESC;

BEGIN;
INSERT INTO "solid_queue_jobs" ("queue_name","active_job_id","priority","scheduled_at","class_name","arguments","concurrency_key","created_at","updated_at") VALUES ('default', '9dc346e3-163c-4897-8803-1b14a5214dfd', 0, NULL, 'TestModelVersionRunJob', '{"job_class":"TestModelVersionRunJob","job_id":"9dc346e3-163c-4897-8803-1b14a5214dfd","provider_job_id":null,"queue_name":"default","priority":null,"arguments":[8],"executions":0,"exception_executions":{},"locale":"en","timezone":"UTC","enqueued_at":"2024-08-20T07:59:42.428216000Z","scheduled_at":null}', NULL, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP), ('default', '2769ab94-f40d-4478-a788-a0bcf211280b', 0, NULL, 'TestModelVersionRunJob', '{"job_class":"TestModelVersionRunJob","job_id":"2769ab94-f40d-4478-a788-a0bcf211280b","provider_job_id":null,"queue_name":"default","priority":null,"arguments":[8],"executions":0,"exception_executions":{},"locale":"en","timezone":"UTC","enqueued_at":"2024-08-20T07:59:42.428270000Z","scheduled_at":null}', NULL, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP), ('default', 'cb4bab58-d44d-4300-9617-6f5a53886841', 0, NULL, 'TestModelVersionRunJob', '{"job_class":"TestModelVersionRunJob","job_id":"cb4bab58-d44d-4300-9617-6f5a53886841","provider_job_id":null,"queue_name":"default","priority":null,"arguments":[8],"executions":0,"exception_executions":{},"locale":"en","timezone":"UTC","enqueued_at":"2024-08-20T07:59:42.428284000Z","scheduled_at":null}', NULL, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP), ('default', '2fdc6e87-8e70-4280-8687-9783f808d2c7', 0, NULL, 'TestModelVersionRunJob', '{"job_class":"TestModelVersionRunJob","job_id":"2fdc6e87-8e70-4280-8687-9783f808d2c7","provider_job_id":null,"queue_name":"default","priority":null,"arguments":[7],"executions":0,"exception_executions":{},"locale":"en","timezone":"UTC","enqueued_at":"2024-08-20T07:59:42.428297000Z","scheduled_at":null}', NULL, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP), ('default', 'db656001-19e9-4e28-89f5-6267deb6a979', 0, NULL, 'TestModelVersionRunJob', '{"job_class":"TestModelVersionRunJob","job_id":"db656001-19e9-4e28-89f5-6267deb6a979","provider_job_id":null,"queue_name":"default","priority":null,"arguments":[7],"executions":0,"exception_executions":{},"locale":"en","timezone":"UTC","enqueued_at":"2024-08-20T07:59:42.428308000Z","scheduled_at":null}', NULL, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP), ('default', '8a5bd758-3774-41ef-8138-0a8924e5fbde', 0, NULL, 'TestModelVersionRunJob', '{"job_class":"TestModelVersionRunJob","job_id":"8a5bd758-3774-41ef-8138-0a8924e5fbde","provider_job_id":null,"queue_name":"default","priority":null,"arguments":[7],"executions":0,"exception_executions":{},"locale":"en","timezone":"UTC","enqueued_at":"2024-08-20T07:59:42.428317000Z","scheduled_at":null}', NULL, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) ON CONFLICT  DO NOTHING RETURNING "id";
SELECT "solid_queue_jobs".* FROM "solid_queue_jobs" WHERE "solid_queue_jobs"."active_job_id" IN ($1, $2, $3, $4, $5, $6);
INSERT INTO "solid_queue_ready_executions" ("queue_name","priority","job_id","created_at") VALUES ('default', 0, 23, CURRENT_TIMESTAMP), ('default', 0, 24, CURRENT_TIMESTAMP), ('default', 0, 25, CURRENT_TIMESTAMP), ('default', 0, 26, CURRENT_TIMESTAMP), ('default', 0, 27, CURRENT_TIMESTAMP), ('default', 0, 28, CURRENT_TIMESTAMP) ON CONFLICT  DO NOTHING RETURNING "id";
SELECT "solid_queue_ready_executions"."job_id" FROM "solid_queue_ready_executions" WHERE "solid_queue_ready_executions"."job_id" IN ($1, $2, $3, $4, $5, $6);
SELECT "solid_queue_blocked_executions"."job_id" FROM "solid_queue_blocked_executions" WHERE "solid_queue_blocked_executions"."job_id" IN ($1, $2, $3, $4, $5, $6);
SELECT "solid_queue_jobs".* FROM "solid_queue_jobs" WHERE "solid_queue_jobs"."id" IN ($1, $2, $3, $4, $5, $6);
COMMIT;

-- Enqueued 6 jobs to SolidQueue (6 TestModelVersionRunJob)

-- Performed TestRunJob (Job ID: 1dd62696-b7f7-49cc-b4e6-b72b466c1bb7) from SolidQueue(default) in 148.29ms

@wwwwhiterabbit wwwwhiterabbit changed the title Bulk job enqueuing [DRAFT] Bulk job enqueuing Aug 20, 2024
@anatoliliotych anatoliliotych deleted the bulk-enqueuing branch August 21, 2024 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant