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

remove resque, use active_job instead #5

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

orangewolf
Copy link

@orangewolf orangewolf commented Sep 26, 2021

This can still be used with Resque, but can now also be used with DelayedJob, Sidekiq or whatever other job processor your Rails app is running. Note that Hyrax uses ActiveJob.

@orangewolf orangewolf marked this pull request as ready for review September 26, 2021 10:02
@orangewolf
Copy link
Author

should have mentioned this the other night, but I'm open to making this an option if that's more desirable.

@cziaarm
Copy link

cziaarm commented Sep 28, 2021

Possibly my own miss configuration elsewhere, but I have found that https://github.com/notch8/irus_analytics/blob/active_job_edition/lib/irus_analytics/irus_analytics_logger.rb#L39-L43 is "hiding" log messages a in a Rails log file when the messages are sent by the worker and Rails is otherwise logging to STDOUT

I stopped this by switching in

                       @@debug_logger ||= if Sidekiq.server?
                           Sidekiq::Logging.logger
                         else
                           Rails.logger
                         end

but that assumes that config.active_job.queue_adapter = :sidekiq and as this PR helps this gem be more generic, I don't want to suggest anything that makes it specific in a different way.... so just raising in case there's a better way to solve (if it is even a problem)

@orangewolf
Copy link
Author

Possibly my own miss configuration elsewhere, but I have found that https://github.com/notch8/irus_analytics/blob/active_job_edition/lib/irus_analytics/irus_analytics_logger.rb#L39-L43 is "hiding" log messages a in a Rails log file when the messages are sent by the worker and Rails is otherwise logging to STDOUT

I stopped this by switching in

                       @@debug_logger ||= if Sidekiq.server?
                           Sidekiq::Logging.logger
                         else
                           Rails.logger
                         end

but that assumes that config.active_job.queue_adapter = :sidekiq and as this PR helps this gem be more generic, I don't want to suggest anything that makes it specific in a different way.... so just raising in case there's a better way to solve (if it is even a problem)

that seems to imply that Rails.logger is not set to stdout in whatever environment your background jobs are running under. Are you sure that RAILS_LOG_TO_STDOUT is set to true on your background worker?

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.

3 participants