Home›Support›English Support›[Waiting for user feedback] Issue with File Modification Time in Kubernetes Environment for WPML String Translation Plugin
[Waiting for user feedback] Issue with File Modification Time in Kubernetes Environment for WPML String Translation Plugin
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Background of the issue:
We are running the WPML String Translation plugin in a Kubernetes-based environment with 9 pods hosting the site. Each pod is constantly updating records in the wp_icl_mo_files_domains table. The function @filemtime($file) returns slightly different results due to containers being launched at different times, leading to discrepancies in file modification times (often by just a few seconds). This causes issues with how the plugin checks file modification timestamps.
UPDATE `wp_icl_mo_files_domains` SET `domain` = 'acf', `status` = 'not_imported', `num_of_strings` = 0, `last_modified` = 1726638200 WHERE `file_path_md5` = '04f6b368cded3ef1c63f57fa4bca095b'
The affected code appears as follows:
} elseif ( $file->get_last_modified() !== $last_modified ) {
The strict comparison between $file->get_last_modified() and $last_modified does not account for minor time differences between containers.
I have checked the latest version of the WPML plugins, and unfortunately, the issue persists. The code in question has not changed in the new version, so the problem remains unresolved.
Our second-tier supporter asks for further clarification from your side.
To investigate this issue further, he needs some more details.
You mentioned that there are two WordPress containers (wordpress1 and wordpress2), both sharing the same volume for WordPress data. From what he understands, since the files and database are shared between the containers, any changes made by one container should be reflected in the other.
However, you also noted that the same files in both Docker containers sometimes have different last modified times. Could you provide some context or explain why this might be happening?
He is asking to determine whether this is an isolated case or a broader issue that needs to be addressed.