#applicationjob — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #applicationjob, aggregated by home.social.
-
One common problem when working with background tasks in Rails is ensuring that the task queue itself is configured and functioning correctly.
For this purpose, I always create a test job that simply writes a test message to the log:
```
class CheckJob < ApplicationJob
queue_as :defaultdef perform
logger = Logger.new(Rails.root.join('log', 'check.log'), level: :info)
logger.info('OK')
end
end
```#Ruby #Rails #ApplicationJob #Job #Task #Background #Cron #Whenever #Check
-
One common problem when working with background tasks in Rails is ensuring that the task queue itself is configured and functioning correctly.
For this purpose, I always create a test job that simply writes a test message to the log:
```
class CheckJob < ApplicationJob
queue_as :defaultdef perform
logger = Logger.new(Rails.root.join('log', 'check.log'), level: :info)
logger.info('OK')
end
end
```#Ruby #Rails #ApplicationJob #Job #Task #Background #Cron #Whenever #Check
-
One common problem when working with background tasks in Rails is ensuring that the task queue itself is configured and functioning correctly.
For this purpose, I always create a test job that simply writes a test message to the log:
```
class CheckJob < ApplicationJob
queue_as :defaultdef perform
logger = Logger.new(Rails.root.join('log', 'check.log'), level: :info)
logger.info('OK')
end
end
```#Ruby #Rails #ApplicationJob #Job #Task #Background #Cron #Whenever #Check