Skip to content

Commit

Permalink
Addressing #290
Browse files Browse the repository at this point in the history
  • Loading branch information
Simbiat committed Dec 7, 2024
1 parent 69ea443 commit 5329145
Show file tree
Hide file tree
Showing 20 changed files with 635 additions and 369 deletions.
2 changes: 1 addition & 1 deletion build/DDL/00-recommended_table_order.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ban__ips ban__mails ban__names bic__acc_type bic__pzn bic__rclose bic__reg bic__rstr bic__settings bic__srvcs cron__settings cron__tasks ffxiv__achievement ffxiv__city ffxiv__clan ffxiv__count_filter ffxiv__enemy ffxiv__grandcompany ffxiv__guardian ffxiv__jobs ffxiv__linkshell_rank ffxiv__nameday ffxiv__orderby ffxiv__pvpteam_rank ffxiv__server ffxiv__timeactive pma__bookmark pma__central_columns pma__column_info pma__designer_settings pma__export_templates pma__favorite pma__history pma__navigationhiding pma__pdf_pages pma__recent pma__relation pma__savedsearches pma__table_coords pma__table_info pma__table_uiprefs pma__tracking pma__userconfig pma__usergroups pma__users seo__pageviews seo__visitors sys__languages sys__log_types sys__settings talks__alt_link_types talks__tags uc__groups uc__permissions uc__users bic__list bic__swift cron__log cron__schedule ffxiv__estate ffxiv__freecompany ffxiv__freecompany_names ffxiv__freecompany_rank ffxiv__freecompany_ranking ffxiv__grandcompany_rank ffxiv__linkshell ffxiv__linkshell_names ffxiv__pvpteam ffxiv__pvpteam_names sys__files sys__logs talks__types uc__cookies uc__emails uc__group_to_permission uc__sessions uc__user_to_group uc__user_to_permission bic__accounts bic__acc_rstr bic__bic_rstr ffxiv__character ffxiv__character_achievement ffxiv__character_clans ffxiv__character_jobs ffxiv__character_names ffxiv__character_servers ffxiv__freecompany_character ffxiv__linkshell_character ffxiv__pvpteam_character talks__sections talks__threads talks__thread_to_tags uc__avatars uc__user_to_section talks__alt_links talks__posts talks__posts_history talks__attachments talks__likes talks__old_music
ban__ips ban__mails ban__names bic__acc_type bic__pzn bic__rclose bic__reg bic__rstr bic__settings bic__srvcs cron__event_types cron__settings cron__tasks ffxiv__achievement ffxiv__city ffxiv__clan ffxiv__count_filter ffxiv__enemy ffxiv__grandcompany ffxiv__guardian ffxiv__jobs ffxiv__linkshell_rank ffxiv__nameday ffxiv__orderby ffxiv__pvpteam_rank ffxiv__server ffxiv__timeactive pma__bookmark pma__central_columns pma__column_info pma__designer_settings pma__export_templates pma__favorite pma__history pma__navigationhiding pma__pdf_pages pma__recent pma__relation pma__savedsearches pma__table_coords pma__table_info pma__table_uiprefs pma__tracking pma__userconfig pma__usergroups pma__users seo__pageviews seo__visitors sys__languages sys__log_types sys__settings talks__alt_link_types talks__tags uc__groups uc__permissions uc__users bic__list bic__swift cron__log cron__schedule ffxiv__estate ffxiv__freecompany ffxiv__freecompany_names ffxiv__freecompany_rank ffxiv__freecompany_ranking ffxiv__grandcompany_rank ffxiv__linkshell ffxiv__linkshell_names ffxiv__pvpteam ffxiv__pvpteam_names sys__files sys__logs talks__types uc__cookies uc__emails uc__group_to_permission uc__sessions uc__user_to_group uc__user_to_permission bic__accounts bic__acc_rstr bic__bic_rstr ffxiv__character ffxiv__character_achievement ffxiv__character_clans ffxiv__character_jobs ffxiv__character_names ffxiv__character_servers ffxiv__freecompany_character ffxiv__linkshell_character ffxiv__pvpteam_character talks__sections talks__threads talks__thread_to_tags uc__avatars uc__user_to_section talks__alt_links talks__posts talks__posts_history talks__attachments talks__likes talks__old_music
4 changes: 3 additions & 1 deletion build/DDL/Data/Cron.sql
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,6 @@ INSERT INTO `cron__schedule` (`task`, `arguments`, `instance`, `system`, `freque

INSERT INTO `cron__schedule` (`task`, `arguments`, `instance`, `system`, `frequency`, `dayofmonth`, `dayofweek`, `priority`, `message`) VALUES ('ffUpdateOld', '[50, \"$cronInstance\"]', '5', '1', '60', NULL, NULL, '0', 'Updating old FFXIV entities');
INSERT INTO `cron__schedule` (`task`, `arguments`, `instance`, `system`, `frequency`, `dayofmonth`, `dayofweek`, `priority`, `message`) VALUES ('ffUpdateOld', '[50, \"$cronInstance\"]', '6', '1', '60', NULL, NULL, '0', 'Updating old FFXIV entities');
UPDATE `cron__settings` SET `value` = '7' WHERE `cron__settings`.`setting` = 'maxThreads';
UPDATE `cron__settings` SET `value` = '7' WHERE `cron__settings`.`setting` = 'maxThreads';

UPDATE `cron__settings` SET `value` = '10' WHERE `cron__settings`.`setting` = 'maxThreads';
2 changes: 2 additions & 0 deletions build/DDL/Data/FFTracker.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8149,3 +8149,5 @@ INSERT IGNORE INTO `ffxiv__server` (`serverid`, `server`, `datacenter`) VALUES
(89, 'Rafflesia', 'Dynamis');

INSERT INTO `ffxiv__jobs`(`name`) VALUES ('Alchemist'), ('Armorer'), ('Astrologian'), ('Bard'), ('Black Mage'), ('Blacksmith'), ('Blue Mage'), ('Botanist'), ('Carpenter'), ('Culinarian'), ('Dancer'), ('Dark Knight'), ('Dragoon'), ('Fisher'), ('Goldsmith'), ('Gunbreaker'), ('Leatherworker'), ('Machinist'), ('Miner'), ('Monk'), ('Ninja'), ('Paladin'), ('Pictomancer'), ('Reaper'), ('Red Mage'), ('Sage'), ('Samurai'), ('Scholar'), ('Summoner'), ('Viper'), ('Warrior'), ('Weaver'), ('White Mage');

UPDATE `ffxiv__achievement` SET `earnedby`=(SELECT COUNT(*) FROM `ffxiv__character_achievement` WHERE `ffxiv__character_achievement`.`achievementid`=`ffxiv__achievement`.`achievementid`);
5 changes: 5 additions & 0 deletions build/DDL/cron__event_types.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE TABLE `cron__event_types` (
`type` varchar(30) NOT NULL COMMENT 'Type of the event',
`description` varchar(100) NOT NULL COMMENT 'Description of the event',
PRIMARY KEY (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci COMMENT='Different event types for logging and SSE output' `PAGE_COMPRESSED`='ON' ROW_FORMAT=Dynamic;
5 changes: 3 additions & 2 deletions build/DDL/cron__log.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ CREATE TABLE `cron__log` (
`task` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL COMMENT 'Optional task ID',
`arguments` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL COMMENT 'Optional task arguments',
`instance` int(10) unsigned DEFAULT NULL COMMENT 'Instance number of the task',
`message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_nopad_ci NOT NULL COMMENT 'Error for the text',
`message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_nopad_ci NOT NULL COMMENT 'Message provided by the event',
KEY `time` (`time`),
KEY `time_desc` (`time` DESC) USING BTREE,
KEY `type` (`type`) USING BTREE,
KEY `runby` (`runby`) USING BTREE,
KEY `task` (`task`) USING BTREE,
CONSTRAINT `errors_to_tasks` FOREIGN KEY (`task`) REFERENCES `cron__tasks` (`task`) ON DELETE CASCADE ON UPDATE CASCADE
CONSTRAINT `cron_log_to_event_type` FOREIGN KEY (`type`) REFERENCES `cron__event_types` (`type`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `cron_log_to_tasks` FOREIGN KEY (`task`) REFERENCES `cron__tasks` (`task`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC `PAGE_COMPRESSED`='ON';
2 changes: 2 additions & 0 deletions build/DDL/cron__schedule.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ CREATE TABLE `cron__schedule` (
`task` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_nopad_ci NOT NULL COMMENT 'Task ID',
`arguments` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_nopad_ci NOT NULL COMMENT 'Optional arguments in JSON string',
`instance` int(10) unsigned NOT NULL DEFAULT 1 COMMENT 'Instance number of the task',
`enabled` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT 'Whether a task instance is enabled and should be run as per schedule',
`system` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Flag indicating whether a task instance is system one and can''t be deleted from Cron\\Schedule class',
`frequency` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Frequency to run a task in seconds',
`dayofmonth` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL COMMENT 'Optional limit to run only on specific days of the month. Expects array of integers in JSON string.',
Expand All @@ -24,5 +25,6 @@ CREATE TABLE `cron__schedule` (
KEY `runby` (`runby`),
KEY `lastrun` (`lastrun`),
KEY `arguments` (`arguments`),
KEY `enabled` (`enabled`),
CONSTRAINT `schedule_to_task` FOREIGN KEY (`task`) REFERENCES `cron__tasks` (`task`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC `PAGE_COMPRESSED`='ON';
6 changes: 5 additions & 1 deletion build/DDL/cron__tasks.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ CREATE TABLE `cron__tasks` (
`parameters` varchar(5000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL COMMENT 'Optional parameters used on initial object creation in JSON string',
`allowedreturns` varchar(5000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL COMMENT 'Optional allowed return values to be treated as ''true'' by Cron processor in JSON string',
`maxTime` int(10) unsigned NOT NULL DEFAULT 3600 COMMENT 'Maximum time allowed for the task to run. If exceeded, it will be terminated by PHP.',
`minFrequency` int(10) unsigned NOT NULL DEFAULT 60 COMMENT 'Minimal allowed frequency (in seconds) at which a task instance can run. Does not apply to one-time jobs.',
`retry` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Custom number of seconds to reschedule a failed task instance for. 0 disables the functionality.',
`enabled` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT 'Whether a task (and thus all its instances) is enabled and should be run as per schedule',
`system` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Flag indicating that task is system and can''t be deleted from Cron\\Task class',
`description` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_nopad_ci DEFAULT NULL COMMENT 'Description of the task',
PRIMARY KEY (`task`)
PRIMARY KEY (`task`),
KEY `enabled` (`enabled`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC `PAGE_COMPRESSED`='ON';
1 change: 1 addition & 0 deletions build/DDL/ffxiv__achievement.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ CREATE TABLE `ffxiv__achievement` (
`category` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_nopad_as_ci DEFAULT NULL COMMENT 'Category of the achievement',
`subcategory` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_nopad_as_ci DEFAULT NULL COMMENT 'Subcategory of the achievement',
`icon` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_nopad_as_ci DEFAULT NULL COMMENT 'Achievement icon without base URL (https://img.finalfantasyxiv.com/lds/pc/global/images/itemicon/)',
`earnedby` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Number of characters that has earned the achievement so far',
`howto` text CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_nopad_ai_ci DEFAULT NULL COMMENT 'Instructions on getting achievements taken from Lodestone',
`points` tinyint(3) unsigned DEFAULT NULL COMMENT 'Amount of points assigned to character for getting the achievement',
`title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_nopad_ai_ci DEFAULT NULL COMMENT 'Optional title rewarded to character',
Expand Down
6 changes: 3 additions & 3 deletions config/frankenphp/cron/php.cron
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*/5 * * * * /usr/local/php/config/cron/php-cron.sh
#* * * * * sleep 20 && /usr/local/php/config/cron/php-cron.sh
#* * * * * sleep 40 && /usr/local/php/config/cron/php-cron.sh
* * * * * /usr/local/php/config/cron/php-cron.sh
* * * * * sleep 20 && /usr/local/php/config/cron/php-cron.sh
* * * * * sleep 40 && /usr/local/php/config/cron/php-cron.sh
0 0 * * * /usr/local/php/config/cron/log-rotate.sh
Loading

0 comments on commit 5329145

Please # to comment.