-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.1] [SOC 21] Add a Scheduled Tasks Infrastructure to Joomla #35143
Merged
Merged
Changes from all commits
Commits
Show all changes
670 commits
Select commit
Hold shift + click to select a range
40a5707
Fix task filter ordering
ditsuke ce3244a
Improve com_scheduler language strings
ditsuke 4edb1e0
Merge branch 'dcon' into 'ditsuke/dcon'
ditsuke 39e29c5
Scheduler runner as a shutdown_function
ditsuke 7b945bf
Enhance task locks and events
ditsuke 5657e20
Add a sanity check to TaskPluginTrait
ditsuke fa7f03b
Fix fatal task failure check
ditsuke f139b51
Increase scheduler plugin hook priority
ditsuke c6e7e82
Fix event dispatchers in the Task class
ditsuke 09892db
Cleanup com_scheduler manifest
ditsuke 46bd367
Add filtering by lock state in TasksModel
ditsuke 06d8fa0
Add task timeout config to "com_scheduler"
ditsuke 28c8361
Update language file for "com_scheduler"
ditsuke 6f5d0f0
Bugfix and update Scheduler API class
ditsuke 595a21f
Add priority column to `#__scheduler_tasks`
ditsuke d77353d
Add task priority to Task form and filter form
ditsuke ef9d44f
Add priority, multi-ordering support to TasksModel
ditsuke 0dfaee0
Update task timeout with config fetch
ditsuke 4b25f26
Add priority-aware task queue to Scheduler class
ditsuke aef5836
Update language files for com_scheduler
ditsuke ff14b57
Bugfix and add an 'Advanced' tab to the task form
ditsuke 5034f02
Enhance orphan task handling in Task driver
ditsuke 0fa3318
Enhance orphan handling in Scheduler, update lang
ditsuke c0270ae
Add demo task routines to stress memory
ditsuke f395a76
Add sleep demo task routine
ditsuke 0319fee
Update language files for plgTaskDemotasks
ditsuke 6d649bc
Cleanup and bugfix com_scheduler
ditsuke 7f9e52d
Improve consistency, extend `#__scheduler_tasks`
ditsuke b343eaa
Remove language autoload from ScheduleRunner
ditsuke 33e6c96
Merge branch dcon into 'ditsuke/dcon'
ditsuke 619b47f
Fix missed errant cast
ditsuke 167fadb
Patch Task::releaseLock()
ditsuke 2a4c8e4
Add plgSystemTaskNotification
ditsuke f1b5aca
Add language files for plgSystemTaskNotifications
ditsuke 7256162
Add SQL DDL for task notification mail templates
ditsuke e3e1c36
Add auto-install SQL (plgSystemTaskNotifications)
ditsuke dbe4f98
Add language autoload for plgSysTaskNotification
ditsuke 6954cd7
Patch auto-install SQL scripts
ditsuke ca01cee
Cleanup plg taskNotification
ditsuke 5bd8870
Fix Scheduler::fetchTasks() default behaviour
ditsuke 71e5501
Add explicit id, title filtering to TasksModel
ditsuke 395a822
Enhance ExecRuleHelper::nextExec()
ditsuke dc7bd30
Add new Task::Status constant
ditsuke 03ae357
Improve comments in the TaskOption class
ditsuke b0470d6
Update the Scheduler class
ditsuke 89b5ffc
Bugfix Task::skipExecution()
ditsuke 47cce8c
Add scheduler:list console command
ditsuke f662964
Add scheduler:run command
ditsuke 585ff22
Add autoload for new commands
ditsuke 573ab73
Merge branch 'dcon' into 'ditsuke/dcon'
ditsuke b9ef576
Add plugin plgTaskCheckFiles
ditsuke 629a9cb
Enhance form for image size routine
ditsuke aa80009
Update form for get_request routine
ditsuke e050cd1
Update language file for com_scheduler
ditsuke cc4106e
Patch task form
ditsuke 98a7451
Merge branch 'dcon' into 'ditsuke/dcon'
ditsuke a9a72d0
Patch exit handling in Task class
ditsuke 2e06126
Patch exit handling in Task class
ditsuke f0dcb33
Add support for mailing task outputs
ditsuke 2a78316
Update SQL for task notification templates
ditsuke 85f1161
Add output file support in GET request routine
ditsuke a34d6cd
Patch task class
ditsuke ae7a652
Disable deprecated routineEndMessage [CheckFiles]
ditsuke 30caaa6
Improve code quality, consistency and style
ditsuke f32a977
Make SchedulerHelper abstract
ditsuke f1d47e7
Add request hash protection for scheduler runner
ditsuke 27b8dff
Bugfix scheduleRunner event subscription behaviour
ditsuke 550fb96
Add rule for manual-only task invocation
ditsuke 60d0c47
Refactor and extend TaskModel, TaskTable
ditsuke ae62135
Update ExecRuleHelper
ditsuke 728683c
Update language constants for com_scheduler
ditsuke 7176ba6
Cleanup Task class
ditsuke f2c1b3d
Update com_scheduler manifest
ditsuke 71d08cd
Merge branch 'dcon' into 'ditsuke/dcon'
ditsuke 98a6d70
Apply code-style suggestions from code review
ditsuke 57c557e
Apply code-style suggestions from code review
ditsuke d8a92bc
Merge branch '4.1-dev' of github.com:joomla/joomla-cms into dcon
bembelimen ba0a60d
Merge branch 'dcon' of https://github.com/joomla-projects/soc21_websi…
ditsuke b9072c7
Clean up usage
bembelimen 14e1c83
Add AJAX requests script to scheduleRunner
ditsuke 2075626
Update manifest for plgSystemScheduleRunner
ditsuke e102278
Add scheduleRunner listener to inject JS
ditsuke 5c0c297
Add scheduleRunner doc and missing checks
ditsuke fa8e09c
Merge PR#24 (cleanup)
ditsuke 895a066
Fix `created_by` auto set on task save
ditsuke c72235d
Cleanup and enhance TaskTable docs
ditsuke 4e4711c
Fix plugin manifests
ditsuke 13888ea
Revert changes to the modules/select template
ditsuke 518dff7
Add standard routine handler
ditsuke 8877509
Fix copyright formatting
ditsuke b9064c2
Update Task\Status
ditsuke f996191
Refactor TaskPluginTrait
ditsuke bc7933d
Improve TaskPluginTrait documentation
ditsuke c521a5b
Implement suggestions on TaskPluginTrait
ditsuke 7ae1a64
Update TaskPluginTrait::standardRoutineHandler()
ditsuke 8d41c26
Update task plugins
ditsuke 09603f0
Ignore user aborts on scheduler trigger
ditsuke be5d3a9
Update TaskPluginTrait doc
ditsuke 24bdb1e
Rename status code
ditsuke d30d0c7
Add config options for scheduleRunner
ditsuke 86b525f
Merge branch 'ajax-trigger' into dcon
ditsuke 40ea8f8
Merge branch 'refactor-task-plugin-trait' into dcon
ditsuke d8c6585
Merge branch 'dcon' into 'ditsuke/dcon'
ditsuke ec6d38e
Add removal of time limit on task runs
bembelimen 1e14d61
Fix broken interval run when setting custom value
bembelimen 5d8f4f2
Set correct lazyCron URL and run it at the beginning
bembelimen c7595d2
Merge branch 'fix-task-created-by' into 'dcon'
ditsuke e367b95
Merge branch 'dcon' of github.com:joomla-projects/soc21_website-cronj…
bembelimen 9af7cc4
Rebuild JS
bembelimen 63bf24b
Finish test cron
bembelimen 7a015df
Fix CS
bembelimen 4ebbc00
Revert SQL query
bembelimen 5ff273f
Add webcron to scheduler config
ditsuke 7a25797
Add webcron key autogen and more to Schedulerunner
ditsuke adbe28f
Add custom field for webcron link
ditsuke a87ef9d
Update com_scheduler language file
ditsuke e281dd9
Merge 'origin/soc/scheduler/play-button' into webcron-key
ditsuke 6fe5542
Fix regression in Scheduler class
ditsuke 09ca90b
Fix test run JS
ditsuke 4e6c8f4
Improve form manipulation code
ditsuke 431591d
Clean up redundant field from Tasks table
ditsuke 954b325
Remove global task configuration config
ditsuke 983ee47
Add task notification config as injected form
ditsuke 2973ad8
Improve plgSystemTaskNotification code style
ditsuke 60e8eb0
Fix params display in task view
bembelimen b3cb99f
Add fieldset labels for task form
ditsuke 31e9b8f
Update task notification logic
ditsuke daffabb
Update plgSystemTaskNotification language file
ditsuke 3c1158e
Merge branch 'soc/scheduler/play-button' into dcon
ditsuke 9b5ddbf
Merge branch 'task-notifications-2' into dcon
ditsuke eb126f2
Fix Task driver behavior
ditsuke c3c83d6
Fix TasksRunCommand regression
ditsuke 064f76f
Fix scheduleRunner default behaviour
ditsuke 882a5f6
Update scheduleRunner language files
ditsuke 9fea821
Update and fix code-style
ditsuke 7f87639
Merge branch 'dcon' into 'ditsuke/dcon'
ditsuke 61c5d1e
Merge branch 'joomla-cms/4.1-dev' into 'dcon'
ditsuke 65f9425
Merge branch 'dcon' into ditsuke-dcon
ditsuke a3fcfe6
Revert drone
ditsuke 4ebdf24
Update com_scheduler language file
ditsuke b6f4dcc
merge branch 'dcon' into 'ditsuke/dcon'
ditsuke d13b286
Apply suggestions from code review
ditsuke cd4428b
Apply suggestions from code review
ditsuke e2f2c65
Update language constants for plgSysScheduleRunner
ditsuke 06f12b8
Merge branch 'dcon' into ditsuke-dcon
ditsuke 1c938dd
Bugfix Task::run()
ditsuke 8df53d5
Merge branch 'dcon' into ditsuke-dcon
ditsuke 7f25375
Fix webcron url & description
ditsuke 51aef6f
Merge branch 'fix-webcron-url' into 'dcon'
ditsuke 8a43d20
Merge branch 'dcon' into 'ditsuke/dcon'
ditsuke 1a8038b
Update joomla.asset.json
bembelimen 233fd3a
Improve the locking mechanism
bembelimen bda45f8
Add table locking when locking task
bembelimen b206a97
CS
bembelimen ed0fc7a
Simplify null date check
bembelimen fab13fa
Add column quote
bembelimen 5b76026
Extend TaskModel's getter method
ditsuke d7d0605
Update Scheduler::getTask() and runTask()
ditsuke e46a143
Fix typos and improve static analysis support
ditsuke e2e61ad
Update/fix Schedulerunner
ditsuke 7495b04
Update Task class
ditsuke e39fe8d
Update Task::releaseLock()
ditsuke d3e518b
Update TaskModel::getTask()
ditsuke da30f73
Improve TaskModel::getTask() mysql compat
ditsuke a370a15
Add unlock function
bembelimen 34d2e85
Fix language strings for the schedulerunner plugin
bembelimen 884ac0c
Update description and remove plugin files
bembelimen c4c6988
Implement Scheduler CLI state changer
bembelimen 98ab295
Update TasksStateCommand.php
bembelimen e6a1feb
Fix list state filter in scheduler
bembelimen 951d29b
Merge pull request #46 from joomla-projects/soc/scheduler/list-filter…
ditsuke 79a5bf9
Fix MySQL lock violations
ditsuke 80cec24
Fix label a11y [#42]
ditsuke 72916fa
Quote 'id'
ditsuke ce53244
Merge pull request #44 from joomla-projects/soc/scheduler/plugin-lang…
ditsuke 12d2006
update publish/unpublish => enable/disable
ditsuke 343f8bf
Add check for checked out tasks
ditsuke 0b45eb8
Improve static analysis support.
ditsuke c4cd19a
Update exit codes and fix typos
ditsuke 0d14e27
Merge pull request #45 from joomla-projects/soc/scheduler/cli
ditsuke 3a68dcb
Merge pull request #43 from joomla-projects/soc/scheduler/unlock
ditsuke 01f75ef
Cleanup
ditsuke 0ed7ff4
Improve task locking for concurrency safety and simplify design
ditsuke 0336149
Fix SQL scripts
ditsuke 358ca7b
Apply Code-style and doc-block improvements from code review
ditsuke 372aef1
Replace Registry inheritance with composition
ditsuke 922947e
Refactor Task::isSuccess()
ditsuke df51ee5
Apply Code-style and doc-block improvements from code review
ditsuke b37c248
Update doc-blocks for the Task driver
ditsuke f8895a7
Merge branch 'task-refactor' into 'dcon'
ditsuke 74a0ef7
Merge branch 4.1-dev of 'joomla/joomla-cms' into 'dcon'
ditsuke 42162fb
Merge branch 'dcon' into 'ditsuke/dcon'
ditsuke 530c93e
Update composer.lock
ditsuke d39ae95
Update composer.lock
ditsuke 7ffa79c
Make Task property getter public [bug]
ditsuke 6030939
Improve task routine exception handling
ditsuke 1ec6550
Update plgScheduleRunner
ditsuke 0660655
Update Task::Status
ditsuke dcce361
Fix exception handling in TaskPluginTrait
ditsuke b6716b1
Cleanup assert exception refs
ditsuke 3c56911
Improve ScheduleRunner documentation.
ditsuke 70e0eab
Improve code style
ditsuke 04ce0ea
Fix demo task form
ditsuke 55b504f
Update language file for `com_scheduler`
ditsuke 0efe6e4
Use output buffering for lazyCron to avoid dying
ditsuke 6625ef9
Merge update SQL
ditsuke 1dc9678
Update plgTaskCheckfiles
ditsuke bfe8075
Merge branch 'dcon' into 'ditsuke/dcon'
ditsuke 1033d6b
Update scheduleRunner docs
ditsuke 48b7d3f
Improve code quality for task unlocking
ditsuke 9e0d9ed
Fix com_scheduler, task plugin code-style
ditsuke 21db0e0
Merge branch 'dcon' into 'ditsuke/dcon'
ditsuke 1e20851
Fix WebcronLinkField::getLayoutPaths()
ditsuke ac4eb03
Merge more update SQL
ditsuke 46b7192
Rename update SQL
ditsuke 488523f
Make plgTaskCheckfiles logging translatable
ditsuke 2909485
Update plgTaskRequests
ditsuke 338e98d
Improve exception handling plgTaskCheckfiles
ditsuke b1a4b4d
Update code-style and language
ditsuke 34c0de3
Merge branch 'dcon' into 'ditsuke/dcon'
ditsuke f9aba46
Merge branch '4.1-dev' into dcon
bembelimen f4792d3
Fix installation and update SQL scripts
richard67 1549e1f
Fix update SQL for PostgreSQL for the database checker
richard67 75b0b31
Add new core extensions to the extensions helper
richard67 e541b57
Merge pull request #49 from richard67/dcon-sql-fixes
ditsuke dd04410
Merge pull request #50 from richard67/dcon-extensions-helper-core-ext…
ditsuke 22e852a
Add auto-install SQL for plg_task_checkfiles
ditsuke 33487f1
Merge branch 'dcon' into 'ditsuke/dcon'
ditsuke 7f5e422
Add DB column for cli exclusive tasks
ditsuke e183ea9
Add support for CLI exclusive tasks
ditsuke dd31ecf
Add comments, fix doc signatures + style
ditsuke f85c536
Merge pull request #51 from joomla-projects/feat-cli-only-tasks
ditsuke 1b4686c
Merge branch 'dcon' into 'ditsuke/dcon'
ditsuke 16b07a8
Merge branch '4.1-dev' into dcon
bembelimen 03dbcf1
Fix get request response body
ditsuke a3fcd96
Merge branch 'dcon' into 'ditsuke/dcon'
ditsuke 5537d97
Add `Scheduler::run()` option for concurrency
ditsuke 5314a89
Update plgSystemSchedulerunner
ditsuke 7a4e651
Make `scheduler:run` safer
ditsuke 865bb7a
Refactor `scheduler:state`
ditsuke 90990fc
Improve `scheduler:run` description style
ditsuke 6252e72
Add utilities, bugfix Task class
ditsuke d1ec907
Improve `scheduler:state` command
ditsuke 9f776a7
Add page reload after testing
bembelimen 6526ce9
Code sniffer fixes
bembelimen 67bcba9
Merge branch 'cli-fixes' into 'dcon'
ditsuke 67c962a
Merge branch 'soc/scheduler/testrundate' into 'dcon'
ditsuke e0be228
Rename param for Scheduler::fetchTaskRecord()
ditsuke 1eee2da
Merge remote branch 'joomla-cms/4.1-dev' into 'dcon'
ditsuke 4a44765
Merge branch 'dcon' into 'ditsuke/dcon'
ditsuke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
administrator/components/com_admin/sql/updates/mysql/4.1.0-2021-11-20.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
-- | ||
-- Table structure for table `#__scheduler_tasks` | ||
-- | ||
|
||
CREATE TABLE IF NOT EXISTS `#__scheduler_tasks` ( | ||
`id` int unsigned NOT NULL AUTO_INCREMENT, | ||
`asset_id` int unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', | ||
`title` varchar(255) NOT NULL DEFAULT '', | ||
`type` varchar(128) NOT NULL COMMENT 'unique identifier for job defined by plugin', | ||
`execution_rules` text COMMENT 'Execution Rules, Unprocessed', | ||
`cron_rules` text COMMENT 'Processed execution rules, crontab-like JSON form', | ||
`state` tinyint NOT NULL DEFAULT FALSE, | ||
`last_exit_code` int NOT NULL DEFAULT 0 COMMENT 'Exit code when job was last run', | ||
`last_execution` datetime COMMENT 'Timestamp of last run', | ||
`next_execution` datetime COMMENT 'Timestamp of next (planned) run, referred for execution on trigger', | ||
`times_executed` int DEFAULT 0 COMMENT 'Count of successful triggers', | ||
`times_failed` int DEFAULT 0 COMMENT 'Count of failures', | ||
`locked` datetime, | ||
`priority` smallint NOT NULL DEFAULT 0, | ||
`ordering` int NOT NULL DEFAULT 0 COMMENT 'Configurable list ordering', | ||
`cli_exclusive` smallint NOT NULL DEFAULT 0 COMMENT 'If 1, the task is only accessible via CLI', | ||
`params` text NOT NULL, | ||
`note` text, | ||
`created` datetime NOT NULL, | ||
`created_by` int UNSIGNED NOT NULL DEFAULT 0, | ||
`checked_out` int unsigned, | ||
`checked_out_time` datetime, | ||
PRIMARY KEY (id), | ||
KEY `idx_type` (`type`), | ||
KEY `idx_state` (`state`), | ||
KEY `idx_last_exit` (`last_exit_code`), | ||
KEY `idx_next_exec` (`next_execution`), | ||
KEY `idx_locked` (`locked`), | ||
KEY `idx_priority` (`priority`), | ||
KEY `idx_cli_exclusive` (`cli_exclusive`), | ||
KEY `idx_checked_out` (`checked_out`) | ||
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 DEFAULT COLLATE = utf8mb4_unicode_ci; | ||
|
||
-- Add `com_scheduler` to `#__extensions` | ||
INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`) VALUES | ||
(0, 'com_scheduler', 'component', 'com_scheduler', '', 1, 1, 1, 0, 1, '', '{}', ''); | ||
|
||
-- Add plugins to `#__extensions` | ||
INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `ordering`, `state`) VALUES | ||
(0, 'plg_system_schedulerunner', 'plugin', 'schedulerunner', 'system', 0, 1, 1, 0, 0, '', '{}', '', 15, 0), | ||
(0, 'plg_system_tasknotification', 'plugin', 'tasknotification', 'system', 0, 1, 1, 0, 1, '', '', '', 22, 0), | ||
(0, 'plg_task_checkfiles', 'plugin', 'checkfiles', 'task', 0, 1, 1, 0, 0, '', '{}', '', 15, 0), | ||
(0, 'plg_task_demotasks', 'plugin', 'demotasks', 'task', 0, 1, 1, 0, 0, '', '{}', '', 15, 0), | ||
(0, 'plg_task_requests', 'plugin', 'requests', 'task', 0, 1, 1, 0, 0, '', '{}', '', 15, 0), | ||
(0, 'plg_task_sitestatus', 'plugin', 'sitestatus', 'task', 0, 1, 1, 0, 0, '', '{}', '', 15, 0); | ||
|
||
-- Add com_scheduler to action logs | ||
INSERT INTO `#__action_logs_extensions` (`extension`) VALUES ('com_scheduler'); | ||
|
||
INSERT INTO `#__action_log_config` (`type_title`, `type_alias`, `id_holder`, `title_holder`, `table_name`, `text_prefix`) VALUES | ||
('task', 'com_scheduler.task', 'id', 'title', '#__scheduler_tasks', 'PLG_ACTIONLOG_JOOMLA'); | ||
|
||
-- Add mail templates | ||
INSERT INTO `#__mail_templates` (`template_id`, `extension`, `language`, `subject`, `body`, `htmlbody`, `attachments`, `params`) VALUES | ||
('plg_system_tasknotification.failure_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_FAILURE_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_FAILURE_MAIL_BODY', '', '', '{"tags": ["task_id", "task_title", "exit_code", "exec_data_time", "task_output"]}'), | ||
('plg_system_tasknotification.fatal_recovery_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_FATAL_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_FATAL_MAIL_BODY', '', '', '{"tags": ["task_id", "task_title"]}'), | ||
('plg_system_tasknotification.orphan_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_ORPHAN_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_ORPHAN_MAIL_BODY', '', '', '{"tags": ["task_id", "task_title", ""]}'), | ||
('plg_system_tasknotification.success_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_SUCCESS_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_SUCCESS_MAIL_BODY', '', '', '{"tags":["task_id", "task_title", "exec_data_time", "task_output"]}'); |
64 changes: 64 additions & 0 deletions
64
administrator/components/com_admin/sql/updates/postgresql/4.1.0-2021-11-20.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
-- | ||
-- Table structure for table "#__scheduler_tasks" | ||
-- | ||
|
||
CREATE TABLE IF NOT EXISTS "#__scheduler_tasks" ( | ||
"id" serial NOT NULL, | ||
"asset_id" bigint DEFAULT 0 NOT NULL, | ||
"title" varchar(255) NOT NULL, | ||
"type" varchar(128) NOT NULL, | ||
"execution_rules" text, | ||
"cron_rules" text, | ||
"state" smallint DEFAULT 0 NOT NULL, | ||
"last_exit_code" integer DEFAULT 0 NOT NULL, | ||
"last_execution" timestamp without time zone, | ||
"next_execution" timestamp without time zone, | ||
"times_executed" integer DEFAULT 0 NOT NULL, | ||
"times_failed" integer DEFAULT 0, | ||
"locked" timestamp without time zone, | ||
"priority" smallint DEFAULT 0 NOT NULL, | ||
"ordering" bigint DEFAULT 0 NOT NULL, | ||
"cli_exclusive" smallint DEFAULT 0 NOT NULL, | ||
"params" text NOT NULL, | ||
"note" text, | ||
"created" timestamp without time zone NOT NULL, | ||
"created_by" bigint DEFAULT 0 NOT NULL, | ||
"checked_out" integer, | ||
"checked_out_time" timestamp without time zone, | ||
PRIMARY KEY ("id") | ||
); | ||
|
||
CREATE INDEX "#__scheduler_tasks_idx_type" ON "#__scheduler_tasks" ("type"); | ||
CREATE INDEX "#__scheduler_tasks_idx_state" ON "#__scheduler_tasks" ("state"); | ||
CREATE INDEX "#__scheduler_tasks_idx_last_exit" ON "#__scheduler_tasks" ("last_exit_code"); | ||
CREATE INDEX "#__scheduler_tasks_idx_next_exec" ON "#__scheduler_tasks" ("next_execution"); | ||
CREATE INDEX "#__scheduler_tasks_idx_locked" ON "#__scheduler_tasks" ("locked"); | ||
CREATE INDEX "#__scheduler_tasks_idx_priority" ON "#__scheduler_tasks" ("priority"); | ||
CREATE INDEX "#__scheduler_tasks_idx_cli_exclusive" ON "#__scheduler_tasks" ("cli_exclusive"); | ||
CREATE INDEX "#__scheduler_tasks_idx_checked_out" ON "#__scheduler_tasks" ("checked_out"); | ||
|
||
-- Add "com_scheduler" to "#__extensions" | ||
INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state") VALUES | ||
(0, 'com_scheduler', 'component', 'com_scheduler', '', 1, 1, 1, 0, 1, '', '{}', '', 0, 0); | ||
|
||
-- Add plugins to "#__extensions" | ||
INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state") VALUES | ||
(0, 'plg_system_schedulerunner', 'plugin', 'schedulerunner', 'system', 0, 1, 1, 0, 0, '', '{}', '', 15, 0), | ||
(0, 'plg_system_tasknotification', 'plugin', 'tasknotification', 'system', 0, 1, 1, 0, 1, '', '', '', 22, 0), | ||
(0, 'plg_task_checkfiles', 'plugin', 'checkfiles', 'task', 0, 1, 1, 0, 0, '', '{}', '', 15, 0), | ||
(0, 'plg_task_demotasks', 'plugin', 'demotasks', 'task', 0, 1, 1, 0, 0, '', '{}', '', 15, 0), | ||
(0, 'plg_task_requests', 'plugin', 'requests', 'task', 0, 1, 1, 0, 0, '', '{}', '', 15, 0), | ||
(0, 'plg_task_sitestatus', 'plugin', 'sitestatus', 'task', 0, 1, 1, 0, 0, '', '{}', '', 15, 0); | ||
|
||
-- Add com_scheduler to action logs extensions | ||
INSERT INTO "#__action_logs_extensions" ("extension") VALUES ('com_scheduler'); | ||
|
||
INSERT INTO "#__action_log_config" ("type_title", "type_alias", "id_holder", "title_holder", "table_name", "text_prefix") VALUES | ||
('task', 'com_scheduler.task', 'id', 'title', '#__scheduler_tasks', 'PLG_ACTIONLOG_JOOMLA'); | ||
|
||
-- Add mail templates | ||
INSERT INTO "#__mail_templates" ("template_id", "extension", "language", "subject", "body", "htmlbody", "attachments", "params") VALUES | ||
('plg_system_tasknotification.failure_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_FAILURE_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_FAILURE_MAIL_BODY', '', '', '{"tags": ["task_id", "task_title", "exit_code", "exec_data_time", "task_output"]}'), | ||
('plg_system_tasknotification.fatal_recovery_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_FATAL_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_FATAL_MAIL_BODY', '', '', '{"tags": ["task_id", "task_title"]}'), | ||
('plg_system_tasknotification.orphan_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_ORPHAN_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_ORPHAN_MAIL_BODY', '', '', '{"tags": ["task_id", "task_title", ""]}'), | ||
('plg_system_tasknotification.success_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_SUCCESS_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_SUCCESS_MAIL_BODY', '', '', '{"tags":["task_id", "task_title", "exec_data_time", "task_output"]}'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<access component="com_scheduler"> | ||
<section name="component"> | ||
<action name="core.admin" title="JACTION_ADMIN" /> | ||
<action name="core.options" title="JACTION_OPTIONS" /> | ||
<action name="core.manage" title="JACTION_MANAGE" /> | ||
<action name="core.create" title="JACTION_CREATE" /> | ||
<action name="core.delete" title="JACTION_DELETE" /> | ||
<action name="core.edit" title="JACTION_EDIT" /> | ||
<action name="core.edit.state" title="JACTION_EDITSTATE" /> | ||
<action name="core.testrun" title="COM_SCHEDULER_PERMISSION_TESTRUN" /> | ||
</section> | ||
<section name="task"> | ||
<action name="core.delete" title="JACTION_DELETE" /> | ||
<action name="core.edit" title="JACTION_EDIT" /> | ||
<action name="core.edit.state" title="JACTION_EDITSTATE" /> | ||
<action name="core.testrun" title="COM_SCHEDULER_PERMISSION_TESTRUN" /> | ||
</section> | ||
</access> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<config> | ||
<fieldset | ||
name="task_config" | ||
label="COM_SCHEDULER_CONFIG_TASKS_FIELDSET_LABEL" | ||
> | ||
<field | ||
name="timeout" | ||
type="number" | ||
label="COM_SCHEDULER_CONFIG_TASK_TIMEOUT_LABEL" | ||
default="300" | ||
required="true" | ||
min="10" | ||
step="1" | ||
validate="number" | ||
filter="int" | ||
/> | ||
</fieldset> | ||
<fieldset | ||
name="lazy_scheduler_config" | ||
label="COM_SCHEDULER_CONFIG_FIELDSET_LAZY_SCHEDULER_LABEL" | ||
description="COM_SCHEDULER_CONFIG_FIELDSET_LAZY_SCHEDULER_DESC" | ||
> | ||
<fields name="lazy_scheduler"> | ||
<field | ||
name="enabled" | ||
type="radio" | ||
label="COM_SCHEDULER_CONFIG_LAZY_SCHEDULER_ENABLED_LABEL" | ||
description="COM_SCHEDULER_CONFIG_LAZY_SCHEDULER_ENABLED_DESC" | ||
layout="joomla.form.field.radio.switcher" | ||
default="1" | ||
required="true" | ||
filter="integer" | ||
> | ||
<option value="0">JDISABLED</option> | ||
<option value="1">JENABLED</option> | ||
</field> | ||
<field | ||
name="interval" | ||
type="NumberField" | ||
label="COM_SCHEDULER_CONFIG_LAZY_SCHEDULER_INTERVAL_LABEL" | ||
description="COM_SCHEDULER_CONFIG_LAZY_SCHEDULER_INTERVAL_DESC" | ||
showon="enabled:1" | ||
min="60" | ||
max="16383" | ||
step="1" | ||
default="300" | ||
/> | ||
</fields> | ||
</fieldset> | ||
<fieldset | ||
name="webcron_config" | ||
label="COM_SCHEDULER_CONFIG_WEBCRON_LABEL" | ||
description="COM_SCHEDULER_CONFIG_WEBCRON_DESC" | ||
> | ||
<fields name="webcron" addfieldprefix="Joomla\Component\Scheduler\Administrator\Field"> | ||
<field | ||
name="enabled" | ||
type="radio" | ||
label="COM_SCHEDULER_CONFIG_WEBCRON_LABEL" | ||
description="COM_SCHEDULER_CONFIG_HASH_PROTECTION_DESC" | ||
layout="joomla.form.field.radio.switcher" | ||
default="0" | ||
required="true" | ||
filter="integer" | ||
> | ||
<option value="0">JDISABLED</option> | ||
<option value="1">JENABLED</option> | ||
</field> | ||
<field | ||
name="generate_key_on_save" | ||
type="note" | ||
description="COM_SCHEDULER_CONFIG_GENERATE_WEBCRON_KEY_DESC" | ||
class="alert alert-warning" | ||
showon="enabled:1" | ||
/> | ||
<field | ||
name="key" | ||
type="hidden" | ||
label="COM_SCHEDULER_CONFIG_GLOBAL_WEBCRON_KEY_LABEL" | ||
readonly="true" | ||
hidden="true" | ||
/> | ||
<field | ||
name="base_link" | ||
type="WebcronLink" | ||
label="COM_SCHEDULER_CONFIG_GLOBAL_WEBCRON_LINK_LABEL" | ||
description="COM_SCHEDULER_CONFIG_GLOBAL_WEBCRON_LINK_DESC" | ||
showon="enabled:1" | ||
readonly="true" | ||
filter="unset" | ||
/> | ||
<field | ||
name="reset_key" | ||
type="radio" | ||
label="COM_SCHEDULER_CONFIG_RESET_WEBCRON_KEY_LABEL" | ||
layout="joomla.form.field.radio.switcher" | ||
default="0" | ||
showon="enabled:1" | ||
required="true" | ||
filter="integer" | ||
> | ||
<option value="0">JNO</option> | ||
<option value="1">JYES</option> | ||
</field> | ||
</fields> | ||
</fieldset> | ||
<fieldset | ||
name="permissions" | ||
label="JCONFIG_PERMISSIONS_LABEL" | ||
description="JCONFIG_PERMISSIONS_DESC" | ||
> | ||
<field | ||
name="rules" | ||
type="rules" | ||
label="JCONFIG_PERMISSIONS_LABEL" | ||
validate="rules" | ||
filter="rules" | ||
section="component" | ||
component="com_scheduler" | ||
/> | ||
</fieldset> | ||
</config> |
74 changes: 74 additions & 0 deletions
74
administrator/components/com_scheduler/forms/filter_tasks.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<form addfieldprefix="Joomla\Component\Scheduler\Administrator\Field"> | ||
<fields name="filter"> | ||
<field | ||
name="search" | ||
type="text" | ||
label="COM_SCHEDULER_FILTER_SEARCH_LABEL" | ||
description="COM_SCHEDULER_FILTER_SEARCH_DESC" | ||
inputmode="search" | ||
hint="JSEARCH_FILTER" | ||
/> | ||
<field | ||
name="state" | ||
type="taskState" | ||
label="JSTATUS" | ||
onchange="this.form.submit();" | ||
validate="options" | ||
> | ||
<option value="">JOPTION_SELECT_PUBLISHED</option> | ||
</field> | ||
<field | ||
name="type" | ||
type="taskType" | ||
label="COM_SCHEDULER_HEADING_TASK_TYPE" | ||
onchange="this.form.submit();" | ||
> | ||
<option value="">COM_SCHEDULER_SELECT_TYPE</option> | ||
</field> | ||
<field | ||
name="orphaned" | ||
type="list" | ||
label="COM_SCHEDULER_FIELD_LABEL_SHOW_ORPHANED" | ||
default="-1" | ||
onchange="this.form.submit()" | ||
> | ||
<option value="-1">COM_SCHEDULER_OPTION_ORPHANED_HIDE</option> | ||
<option value="0">COM_SCHEDULER_OPTION_ORPHANED_SHOW</option> | ||
<option value="1">COM_SCHEDULER_OPTION_ORPHANED_ONLY</option> | ||
</field> | ||
</fields> | ||
|
||
<fields name="list"> | ||
<!-- @todo: Add options for execution date(s) --> | ||
<field | ||
name="fullordering" | ||
type="list" | ||
label="JGLOBAL_SORT_BY" | ||
onchange="this.form.submit();" | ||
default="a.title DESC" | ||
validate="options" | ||
> | ||
<option value="">JGLOBAL_SORT_BY</option> | ||
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option> | ||
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option> | ||
<option value="a.title ASC">JGLOBAL_TITLE_ASC</option> | ||
<option value="a.title DESC">JGLOBAL_TITLE_DESC</option> | ||
<option value="j.type_title ASC">COM_SCHEDULER_TASK_TYPE_ASC</option> | ||
<option value="j.type_title DESC">COM_SCHEDULER_TASK_TYPE_DESC</option> | ||
<option value="a.state ASC">JSTATUS_ASC</option> | ||
<option value="a.state DESC">JSTATUS_DESC</option> | ||
<option value="a.ordering ASC">JGRID_HEADING_ORDERING_ASC</option> | ||
<option value="a.ordering DESC">JGRID_HEADING_ORDERING_DESC</option> | ||
<option value="a.priority ASC">COM_SCHEDULER_TASK_PRIORITY_ASC</option> | ||
<option value="a.priority DESC">COM_SCHEDULER_TASK_PRIORITY_DESC</option> | ||
</field> | ||
<field | ||
name="limit" | ||
type="limitbox" | ||
label="JGLOBAL_LIST_LIMIT" | ||
default="25" | ||
onchange="this.form.submit();" | ||
/> | ||
</fields> | ||
</form> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This list should be sorted to match the order of the displayed columns