mirror of
https://github.com/rickbarrette/redmine_scheduler.git
synced 2026-10-03 13:30:43 -04:00
Inital Commit
This commit is contained in:
commit
97b2fe47e7
3 files changed
+71
No files matched your search
@@ -0,0 +1,20 @@
|
||||
#The MIT License (MIT)
|
||||
#
|
||||
#Copyright (c) 2016 - 2026 rick barrette
|
||||
#
|
||||
#Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
#The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
#
|
||||
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
Redmine::Plugin.register :redmine_scheduler do
|
||||
name 'Redmine Scheduler Plugin'
|
||||
author 'Rick Barrette'
|
||||
description 'Provides scheduled execution triggers for Redmine plugins via custom hooks.'
|
||||
version '2026.8.0'
|
||||
url 'https://github.com/rickbarrette/redmine_qbo/redmine_scheduler'
|
||||
author_url 'https://github.com/rickbarrette/redmine_qbo'
|
||||
|
||||
# Require the core scheduler runner logic
|
||||
requires_redmine version_or_higher: '5.0.0'
|
||||
end
|
||||
@@ -0,0 +1,29 @@
|
||||
#The MIT License (MIT)
|
||||
#
|
||||
#Copyright (c) 2016 - 2026 rick barrette
|
||||
#
|
||||
#Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
#The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
#
|
||||
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
module RedmineScheduler
|
||||
class Runner
|
||||
class << self
|
||||
# Executes hourly routine and triggers registered listeners
|
||||
def run_hourly
|
||||
Rails.logger.info "[RedmineScheduler] Triggering hourly hooks..."
|
||||
|
||||
# Call generic hourly hook
|
||||
Redmine::Hook.call_hook(:redmine_scheduler_hourly, timestamp: Time.current)
|
||||
end
|
||||
|
||||
# Executes daily routine
|
||||
def run_daily
|
||||
Rails.logger.info "[RedmineScheduler] Triggering daily hooks..."
|
||||
|
||||
Redmine::Hook.call_hook(:redmine_scheduler_daily, timestamp: Time.current)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,22 @@
|
||||
#The MIT License (MIT)
|
||||
#
|
||||
#Copyright (c) 2016 - 2026 rick barrette
|
||||
#
|
||||
#Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
#The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
#
|
||||
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
namespace :redmine_scheduler do
|
||||
desc "Run hourly scheduled hooks"
|
||||
task run_hourly: :environment do
|
||||
require File.expand_path('../../redmine_scheduler/runner', __FILE__)
|
||||
RedmineScheduler::Runner.run_hourly
|
||||
end
|
||||
|
||||
desc "Run daily scheduled hooks"
|
||||
task run_daily: :environment do
|
||||
require File.expand_path('../../redmine_scheduler/runner', __FILE__)
|
||||
RedmineScheduler::Runner.run_daily
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user