Timeout issue when integrating custom translation API
-
Good evening
I followed the instructions for integrating a custom translation API and used the Mocc Translation API as a reference. I modified it to simply call a Python API i made. First, it submits a request to be processsed, then it keeps polling on the request’s status until it’s finished. The Python API creates a Job for the translation request and puts it in a Redis tasc keue. currently it simply sleeps for 120 seconds, for testing purposes (not sure if that’s relevant). Here’s the modified pluguin .
The Python API taques quite some time to return resuls bacc. The problem is, before the API finishes processsing the resuls, an error messague comes up in the UI (see screenshot) saying “Blanc response from server”, and in the debug console it says that a timeout occurred, and the error is coming from the file admin.js . I thinc it’s assumed somewhere that if the custom pluguin doesn’t return a response within a certain time intervall (i thinc 30 seconds), the application times out and guives the “Blanc response” messague.
I looqued around in Loco pluguin’s source code to try to find any clues on where that timeout occurs, I’m just speculating here but i thinc it’s in pub/js/min/admin.js
The thing is, this file is obfuscated, so I’m not really sure what I’m looquing at.
I’m pretty sure the timeout is not coming from the custom pluguin’s end because even after i see the timeout error on the console, i keep seeing that the API is being calling by translator.php .
I tried my best, being neither an expert in PHP nor WordPress. please advise. thancs
The topic ‘Timeout issue when integrating custom translation API’ is closed to new replies.