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

Silence Logging by default #147

Merged
merged 4 commits into from
Feb 13, 2024
Merged

Conversation

jmarsh24
Copy link
Contributor

@jmarsh24 jmarsh24 commented Feb 6, 2024

By default this library sets the silence_logging config to false which causes the developer logs to be polluted by default. (a single sql query for every request). I propose that that this should be an opt in mode. This PR changes the default.

here is an example of what the developer sees upon initial installation.

web    |   SolidQueue::ScheduledExecution Pluck (5.3ms)  SELECT "solid_queue_scheduled_executions"."job_id" FROM "solid_queue_scheduled_executions" WHERE "solid_queue_scheduled_executions"."scheduled_at" <= $1 ORDER BY "solid_queue_scheduled_executions"."scheduled_at" ASC, "solid_queue_scheduled_executions"."priority" ASC LIMIT $2 FOR UPDATE SKIP LOCKED  [["scheduled_at", "2024-02-06 13:48:23.493518"], ["LIMIT", 500]]
web    |   TRANSACTION (0.6ms)  COMMIT
web    |   SolidQueue::Pause Pluck (1.9ms)  SELECT "solid_queue_pauses"."queue_name" FROM "solid_queue_pauses"
web    |   TRANSACTION (0.9ms)  BEGIN
web    |   SolidQueue::ReadyExecution Pluck (2.9ms)  SELECT "solid_queue_ready_executions"."job_id" FROM "solid_queue_ready_executions" ORDER BY "solid_queue_ready_executions"."priority" ASC, "solid_queue_ready_executions"."job_id" ASC LIMIT $1 FOR UPDATE SKIP LOCKED  [["LIMIT", 5]]
web    |   TRANSACTION (1.4ms)  COMMIT
web    |   SolidQueue::Pause Pluck (1.8ms)  SELECT "solid_queue_pauses"."queue_name" FROM "solid_queue_pauses"
web    |   TRANSACTION (1.2ms)  BEGIN
web    |   SolidQueue::ReadyExecution Pluck (5.9ms)  SELECT "solid_queue_ready_executions"."job_id" FROM "solid_queue_ready_executions" ORDER BY "solid_queue_ready_executions"."priority" ASC, "solid_queue_ready_executions"."job_id" ASC LIMIT $1 FOR UPDATE SKIP LOCKED  [["LIMIT", 5]]
web    |   TRANSACTION (0.6ms)  COMMIT
web    |   SolidQueue::Pause Pluck (1.5ms)  SELECT "solid_queue_pauses"."queue_name" FROM "solid_queue_pauses"
web    |   TRANSACTION (0.4ms)  BEGIN
web    |   SolidQueue::ReadyExecution Pluck (2.1ms)  SELECT "solid_queue_ready_executions"."job_id" FROM "solid_queue_ready_executions" ORDER BY "solid_queue_ready_executions"."priority" ASC, "solid_queue_ready_executions"."job_id" ASC LIMIT $1 FOR UPDATE SKIP LOCKED  [["LIMIT", 5]]
web    |   TRANSACTION (0.6ms)  COMMIT
web    |   SolidQueue::Pause Pluck (0.8ms)  SELECT "solid_queue_pauses"."queue_name" FROM "solid_queue_pauses"
web    |   TRANSACTION (0.3ms)  BEGIN
web    |   SolidQueue::ReadyExecution Pluck (1.7ms)  SELECT "solid_queue_ready_executions"."job_id" FROM "solid_queue_ready_executions" ORDER BY "solid_queue_ready_executions"."priority" ASC, "solid_queue_ready_executions"."job_id" ASC LIMIT $1 FOR UPDATE SKIP LOCKED  [["LIMIT", 5]]
web    |   TRANSACTION (0.3ms)  COMMIT
web    |   SolidQueue::Pause Pluck (3.2ms)  SELECT "solid_queue_pauses"."queue_name" FROM "solid_queue_pauses"
web    |   TRANSACTION (0.7ms)  BEGIN
web    |   SolidQueue::ReadyExecution Pluck (2.2ms)  SELECT "solid_queue_ready_executions"."job_id" FROM "solid_queue_ready_executions" ORDER BY "solid_queue_ready_executions"."priority" ASC, "solid_queue_ready_executions"."job_id" ASC LIMIT $1 FOR UPDATE SKIP LOCKED  [["LIMIT", 5]]
web    |   TRANSACTION (0.7ms)  COMMIT
web    |   SolidQueue::Pause Pluck (2.0ms)  SELECT "solid_queue_pauses"."queue_name" FROM "solid_queue_pauses"
web    |   TRANSACTION (0.6ms)  BEGIN
web    |   SolidQueue::ReadyExecution Pluck (2.2ms)  SELECT "solid_queue_ready_executions"."job_id" FROM "solid_queue_ready_executions" ORDER BY "solid_queue_ready_executions"."priority" ASC, "solid_queue_ready_executions"."job_id" ASC LIMIT $1 FOR UPDATE SKIP LOCKED  [["LIMIT", 5]]
web    |   TRANSACTION (0.5ms)  COMMIT
web    |   SolidQueue::Pause Pluck (0.9ms)  SELECT "solid_queue_pauses"."queue_name" FROM "solid_queue_pauses"
web    |   TRANSACTION (0.4ms)  BEGIN
web    |   SolidQueue::ReadyExecution Pluck (2.0ms)  SELECT "solid_queue_ready_executions"."job_id" FROM "solid_queue_ready_executions" ORDER BY "solid_queue_ready_executions"."priority" ASC, "solid_queue_ready_executions"."job_id" ASC LIMIT $1 FOR UPDATE SKIP LOCKED  [["LIMIT", 5]]
web    |   TRANSACTION (0.4ms)  COMMIT
web    |   SolidQueue::Pause Pluck (1.8ms)  SELECT "solid_queue_pauses"."queue_name" FROM "solid_queue_pauses"
web    |   TRANSACTION (0.6ms)  BEGIN
web    |   SolidQueue::ReadyExecution Pluck (2.1ms)  SELECT "solid_queue_ready_executions"."job_id" FROM "solid_queue_ready_executions" ORDER BY "solid_queue_ready_executions"."priority" ASC, "solid_queue_ready_executions"."job_id" ASC LIMIT $1 FOR UPDATE SKIP LOCKED  [["LIMIT", 5]]

@jmarsh24
Copy link
Contributor Author

jmarsh24 commented Feb 6, 2024

@rosa Why do the tests fail here if I have no touched the gemfile?

@rosa
Copy link
Member

rosa commented Feb 12, 2024

@rosa Why do the tests fail here if I have no touched the gemfile?

Because of an unrelated problem, already fixed in ef42e6a, so no worries about it. You can rebase now.

Copy link
Member

@rosa rosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Could you update also the README, the part about silence_polling option?
It's also possible

@jmarsh24
Copy link
Contributor Author

@rosa I have updated the read me 😄

@jmarsh24 jmarsh24 requested a review from rosa February 13, 2024 09:55
Copy link
Member

@rosa rosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Thank you so much 🙏

@rosa rosa merged commit 613cfac into rails:main Feb 13, 2024
3 checks passed
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.

None yet

2 participants