http://qs321.pair.com?node_id=571766

schulerlab has asked for the wisdom of the Perl Monks concerning the following question:

Is there any way to build a Pause or something into a routine to keep a rebuild of a large database from timing out? Something that tells the system that the process is not in an endless loop, but is just in a long processing routine?

Replies are listed 'Best First'.
Re: timeout on a valid long process
by b10m (Vicar) on Sep 07, 2006 at 19:14 UTC

    Who's timing it out? A webserver? If so, just read up on auto flushing ($|) and print some null bytes (\0) to the browser every now and then, to keep the connection alive.

    Update: ... and you can read a column by merlyn on watching long processes through CGI.

    --
    b10m

    All code is usually tested, but rarely trusted.
      Thanks. I will check into this.
Re: timeout on a valid long process
by GrandFather (Saint) on Sep 07, 2006 at 18:32 UTC

    What system needs to be told?


    DWIM is Perl's answer to Gödel
      you mean what type of server? this program runs on different types of servers. Mostly Apache servers. The process is rebuilding a database. Not a problem for a database that isn't huge. but the process timesout for databases of around 50k messages. Even though there is really nothing wrong with the program.

        Look at the Timeout keyword in the Apache config file. You can also dump \0 characters to the client periodically to ensure that it does not time out (vs the server timing out).

        --MidLifeXis

      oh my.. my reputation is 0! what would my mother say?