pythonmoinmoin

How to manually invoke SpellCheck avoiding Browser timeout


I'm trying to update the SpellChecker in my local MoinMoin installation according to this documentation page: https://moinmo.in/HelpOnSpellCheck.

I followed the steps, got a new dictionary file and sym-linked it into data/dict directory in the MoinMoin installation path. I then deleted /data/cache/spellchecker.dict, which should be rebuilt upon invoking the SpellCheck action. If I visit my Wiki and use SpellCheck, the browser times out upon building the SpellCheck database, as expected according to the link above.

In the documentation it says: "If your browser or the webserver timeouts before the file is completely built, one solution is to telnet into your webserver, and manually request the page." This is what I'm trying to do. Unfortunately the request does not seem to invoke the database creation and quickly returns the requested page.

Here is how I requested the page (I'm hosting it locally over port 8085):

telnet 192.168.1.199 8085
Trying 192.168.1.199...
Connected to 192.168.1.199.
Escape character is '^]'.
HEAD /wiki/FrontPage?action=SpellCheck HTTP/1.1
Host: 192.168.1.199

HTTP/1.1 200 OK
...

I would expect that the request invokes the database creation, as it does in a web browser. This should take a few minutes and I should afterwards be able to find the created database in /data/cache/. Unfortunately this does not happen.


Solution

  • If anyone else is interested, here is how I ended up solving the problem: I narrowed the possible timeouts down to either the webserver (nginx) or uwsgi, hence I did the following changes to the config-files:

    In /etc/moin/uwsgi.ini:

    harakiri 9999
    

    In /etc/nginx/nginx.conf:

    uwsgi_read_timeout 9999
    uwsgi_send_timeout 9999
    

    I then used the python package requests to send the get-request to the server:

    import requests
    
    r = requests.get('http://192.168.1.199:8085/wiki/FrontPage',
                     params={'action' : 'SpellCheck'}, timeout=9999)
    

    This ran for about 2-3 minutes. Afterwards, the word count shown when performing a spelling check was 629182, reflecting the number of words present in my dictionary.