馃殌 Enhanced ESX Core Cron Task Handling #1130
Merged
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.
Description:
This commit brings substantial enhancements to the time handling functionality in the 'esx_core/[core]/cron/server/main.lua' script for the FiveM server:
Utilized Unix Timestamps: Replaced the existing
GetTime()
function withGetUnixTimestamp()
, ensuring precise time representation by using the Unix timestamp format (seconds since January 1, 1970). This change mitigates potential issues related to Daylight Saving Time (DST) transitions.Refined Task Execution Logic: The
OnTime
function has been refactored to operate based on Unix timestamps, ensuring accurate execution of scheduled tasks without any inconsistencies due to local time conversions.By introducing these improvements, the cron-like system now operates with enhanced accuracy, bolstering the stability and predictability of scheduled events on the FiveM server. Extensive testing has been conducted to guarantee compatibility with various server environments.