{"id":18708010,"url":"https://github.com/discourse/mini_scheduler","last_synced_at":"2025-05-16T13:03:54.609Z","repository":{"id":32701439,"uuid":"140348399","full_name":"discourse/mini_scheduler","owner":"discourse","description":"Adds recurring jobs for Sidekiq","archived":false,"fork":false,"pushed_at":"2024-03-01T05:08:01.000Z","size":79,"stargazers_count":172,"open_issues_count":3,"forks_count":7,"subscribers_count":23,"default_branch":"main","last_synced_at":"2024-05-09T09:26:26.834Z","etag":null,"topics":["rubygem"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/discourse.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-09T22:24:15.000Z","updated_at":"2024-06-18T19:48:05.336Z","dependencies_parsed_at":"2024-06-18T19:48:01.931Z","dependency_job_id":"42eacd62-2a46-4b62-93cf-6ad0ec06b386","html_url":"https://github.com/discourse/mini_scheduler","commit_stats":{"total_commits":69,"total_committers":12,"mean_commits":5.75,"dds":0.7681159420289855,"last_synced_commit":"90e4fbf333213c07e1266c73e2e6a1e865c49c06"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fmini_scheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fmini_scheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fmini_scheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discourse%2Fmini_scheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/discourse","download_url":"https://codeload.github.com/discourse/mini_scheduler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254535826,"owners_count":22087398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rubygem"],"created_at":"2024-11-07T12:20:57.638Z","updated_at":"2025-05-16T13:03:54.575Z","avatar_url":"https://github.com/discourse.png","language":"Ruby","readme":"[![Build Status](https://github.com/discourse/mini_scheduler/workflows/CI/badge.svg)](https://github.com/discourse/mini_scheduler/actions)\n[![Gem Version](https://badge.fury.io/rb/mini_scheduler.svg)](https://rubygems.org/gems/mini_scheduler)\n\n# MiniScheduler\n\nMiniScheduler adds recurring jobs to [Sidekiq](https://sidekiq.org/).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```rb\ngem 'mini_scheduler'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install mini_scheduler\n\nIn a Rails application, create files needed in your application to configure mini_scheduler:\n\n    $ bin/rails g mini_scheduler:install\n    $ bin/rails db:migrate\n\nAn initializer is created named `config/initializers/mini_scheduler.rb` which lists all the configuration options.\n\n## Configuring MiniScheduler\n\nBy default each instance of MiniScheduler will run with a single worker. To amend this behavior:\n\n```rb\nif Sidekiq.server? \u0026\u0026 defined?(Rails)\n  Rails.application.config.after_initialize do\n    MiniScheduler.start(workers: 5)\n  end\nend\n```\n\nThis is useful for cases where you have extremely long running tasks that you would prefer did not starve.\n\n## Usage\n\nCreate jobs with a recurring schedule like this:\n\n```rb\nclass MyHourlyJob\n  include Sidekiq::Worker\n  extend MiniScheduler::Schedule\n\n  every 1.hour\n\n  def execute(args)\n    # some tasks\n  end\nend\n```\n\nOptions for schedules:\n\n- **queue** followed by a queue name, like \"queue :email\", default queue is \"default\"\n- **every** followed by a duration in seconds, like \"every 1.hour\".\n- **daily at:** followed by a duration since midnight, like \"daily at: 12.hours\", to run only once per day at a specific time.\n\nTo view the scheduled jobs, their history, and the schedule, go to sidekiq's web UI and look for the \"Scheduler\" tab at the top.\n\nTo enable this view in Sidekiq, add `require \"mini_scheduler/web\"` to `routes.rb`:\n\n```rb\nrequire \"sidekiq/web\"\nrequire \"mini_scheduler/web\"\n\nRails.application.routes.draw do\n ...\nend\n```\n\n## How to reach us\n\nIf you have questions about using mini_scheduler or found a problem, you can find us at https://meta.discourse.org.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscourse%2Fmini_scheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiscourse%2Fmini_scheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscourse%2Fmini_scheduler/lists"}