FS#48 - Ajax for autosync transaction & save
Opened by Strict Standards: array_map() expects parameter 1 to be a valid callback, non-static method Filters::noXSS() should not be called statically in /data/web/a5/4e/8e/bugs.anwiki.com/htdocs/includes/class.tpl.php on line 281 anw (anw) - Strict Standards: Non-static method Filters::noXSS() should not be called statically in /data/web/a5/4e/8e/bugs.anwiki.com/htdocs/includes/class.tpl.php on line 613 Monday, 25 January 2010, 22:46 GMT
|
DetailsCurrently, when a content is edited in one language and has to be saved:
- a mysql transaction is opened - each translation is processed by autosync engine, in the same php thread - each updated translations are checked for similar structure, to make sure they are in sync and to avoid potential autosync bugs - each translation is saved - mysql transaction is commited This operation may be very long for large contents, and processing time is increasing with the number of translations. This is also memory consuming, and PHP process may be killed on some restrictive hosts it it exceeds memory_limit or max_execution_time. To avoid this, I'm thinking to dispatch execute autosync application & save with Ajax saving: - when pressing on the "save" button, an Ajax controller is instancied and a progress bar is displayed - an ajax calls autosync engine for each translation, in parallels php threads - each thread applies autosync to one translation, checks the result, then save it on a temporary table - when Ajax controller detects gets all responses, it starts a last thread for "commiting" these changes (updating the real table from the temporary one) - save process is finished, progress bar is now 100% and edition lock is released. - temporary table is regularly cleaned - this temporary table could also be used to preview expected autosync results on all translations |
