Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Chronofage is a Cron (or whatever scheduler you want) and ActiveRecord based ActiveJob backend. It is well suited for long-running tasks (heavy video processing, render, etc). Every job is run in its own process and you can spread the work on multiple hosts.
Copy the migration file and run it to create the chronofage_jobs
table.
rake chronofage_engine:install:migrations db:migrate
The chronofage_jobs
table hold informations about all the jobs ready to be executed, failed or done.
create_table "chronofage_jobs", force: :cascade do |t|
t.string "job_class"
t.string "job_id"
t.string "queue_name"
t.text "arguments"
t.integer "priority"
t.datetime "started_at" # set when a job is started
t.datetime "completed_at" # set when a job is completed successfuly
t.datetime "failed_at" # set when a job failed
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
You can selectively override the ActiveJob backend for your very long-runny task.
class BuildCompilationJob < ApplicationJob
self.queue_adapter = :chronofage
queue_as :heavy
def perform(compilation_settings)
# long-running stuff
end
end
Then jobs can be run with a simple Rake task taking a queue name and a concurrency argument.
rake chronofage_engine:jobs:execute[heavy,2]
The task can be run from Cron or any task scheduler you like (the Windows task scheduler, the Heroku scheduler plugin, etc). The concurrency argument is host-based, so a Cron config like the following one, spread on 3 hosts, will execute a maximum of 6 jobs, 2 for each host, and check for new jobs every 5 minutes.
*/5 * * * * cd /var/www/my_app && rake chronofage_engine:jobs:execute[heavy,2]
You can also make Chronofage poll the database for new jobs to execute, this solution is way more reactive.
rake chronofage_engine:jobs:poll[heavy,2]
FAQs
Unknown package
We found that chronofage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.