[PR #34] [MERGED] Added :within option to Period to run only within given time interval. #85

Closed
opened 2025-12-29 00:22:27 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/plashchynski/crono/pull/34
Author: @lhz
Created: 10/3/2015
Status: Merged
Merged: 1/16/2016
Merged by: @plashchynski

Base: masterHead: intervals


📝 Commits (2)

  • a93b937 Added :within option to Period to run only within given time interval.
  • 4b7b03f Convert TimeOfDay values to UTC.

📊 Changes

5 files changed (+106 additions, -3 deletions)

View changed files

📝 lib/crono.rb (+2 -0)
lib/crono/interval.rb (+43 -0)
📝 lib/crono/period.rb (+14 -3)
lib/crono/time_of_day.rb (+36 -0)
📝 spec/period_spec.rb (+11 -0)

📄 Description

Added feature to run a job within a given time interval only.

Examples:

Crono::Period.new 15.minutes, within: '08:00-16:00' # Every 15 minutes during work hours

Crono::Period.new 1.hour, within: {from: '23:00', to: '07:00'} # Hourly during period of low traffic

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/plashchynski/crono/pull/34 **Author:** [@lhz](https://github.com/lhz) **Created:** 10/3/2015 **Status:** ✅ Merged **Merged:** 1/16/2016 **Merged by:** [@plashchynski](https://github.com/plashchynski) **Base:** `master` ← **Head:** `intervals` --- ### 📝 Commits (2) - [`a93b937`](https://github.com/plashchynski/crono/commit/a93b937d1424b737cda03f9000483df175d8d32d) Added :within option to Period to run only within given time interval. - [`4b7b03f`](https://github.com/plashchynski/crono/commit/4b7b03f8a1802e27520603f76bd40bd5090fd7f1) Convert TimeOfDay values to UTC. ### 📊 Changes **5 files changed** (+106 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `lib/crono.rb` (+2 -0) ➕ `lib/crono/interval.rb` (+43 -0) 📝 `lib/crono/period.rb` (+14 -3) ➕ `lib/crono/time_of_day.rb` (+36 -0) 📝 `spec/period_spec.rb` (+11 -0) </details> ### 📄 Description Added feature to run a job within a given time interval only. Examples: ``` ruby Crono::Period.new 15.minutes, within: '08:00-16:00' # Every 15 minutes during work hours Crono::Period.new 1.hour, within: {from: '23:00', to: '07:00'} # Hourly during period of low traffic ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 00:22:27 +01:00
adam closed this issue 2025-12-29 00:22:29 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/crono#85