Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
A rails plugin to manage batch scripts. Provide web interface to create, edit and execute batch scripts simply. Automatically save the log to file.
Add to your Gemfile
gem 'batch_manager'
and bundle
bundle
initialize
bundle exec rails generate batch_manager:migration
bundle exec rake db:migrate
This will create a table 'schema_batches' like 'schema_migrations' to save the status of batches in database.
config.batch_manager.batch_dir = "script/batch"
config.batch_manager.save_log = true
config.batch_manager.log_dir = "log/batch"
You can change the default configuration in config/application.rb
bundle exec rails g batch test
This will generate the file 'test.rb' in the configured batch_dir with default template.
You can simply override the default template by making a template file with the name 'batch.rb' inside lib/templates/rails/batch.
The generated batch files will have the header like:
# =Batch Manager=
# =created_at: 2013-05-24 13:10:25
# =times_limit: 1
Add the "=Batch Manager=" to tell BatchManager to manage this batch file.
You can also add these headers to the existing batch files.
bundle exec bm_exec [options] BATCH_FILE
Please use this command instead of 'rails runner' to run batch scripts.
options:
-f, --force Force to run
-w, --wet Wet run
-d, --daemon COMMAND Daemon mode
Use -d
option to run batch as daemon.
# start daemon
bundle exec bm_exec -d start BATCH_FILE
# stop daemon
bundle exec bm_exec -d stop BATCH_FILE
Please use BatchManager.logger in batch scripts to output logs, and then BatchManager will automatically also output logs to the file in the configured log directory.
BatchManager.logger.debug
BatchManager.logger.info
BatchManager.logger.warn
BatchManager.logger.error
BatchManager.logger.fatal
When batches executed without BatchManager, it will write log to $stdout as default.
Mount the web interface in the routes file.
mount BatchManager::Engine, :at => "batch_manager"
You can also use web interface to execute batches.
If resque installed in you application and the resque worker started, the batch script can be executed asynchronous through the worker. And the log can be checked on real time in the brower. Otherwise the batch script will be executed synchronous.
The QUEUE's name will be "batch_manager".
show all batches
bundle exec rake batch:list
show the details of batches
bundle exec rake batch:details
FAQs
Unknown package
We found that batch_manager demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.