Pages: [1]
Author Topic: Mochi PHP time out, applies to cron job too?  (Read 467 times)
Customers
Full Member
*

Karma: 0
Posts: 67


Email
on: Feb 03, 10, 12:45 AM

My importing Mochi games always times out after 28 seconds.  What I want to know is if this will also apply to imports set up as cron jobs?
Logged
Customers
Full Member
*

Karma: 0
Posts: 43


Reply #1 on: Feb 03, 10, 03:17 AM

Yes, cron job "launches" script and if your hosting has max execution time 28 seconds, then you're screwed. I had similar problem and asked for more time. I got 10 minutes!!!! Smiley
Logged
Administrator
Sr. Member
*

Karma: 7
Posts: 486


Email
Reply #2 on: Feb 03, 10, 06:55 AM

on some hosters it's enough to put a custom php.ini in a folder where your script (php file which you are calling) is located.... I believe there were a discussion about custom php.ini on this forum, try to seach for either php.ini or max filesize
Logged
Customers
Full Member
*

Karma: 0
Posts: 43


Reply #3 on: Feb 05, 10, 06:27 AM

I think Sergey meant max execution time and not max filesize..

btw. Sergey, when is the patch coming?
Logged
Administrator
Sr. Member
*

Karma: 7
Posts: 486


Email
Reply #4 on: Feb 05, 10, 08:17 AM

the discussion which I mentioned in my previous message was about max filesize, so if you want to find anything about custom php.ini, search for max filesize. That's not a mistake.
Logged
Customers
Full Member
*

Karma: 0
Posts: 67


Email
Reply #5 on: Feb 13, 10, 10:44 PM

I did a search for "php.ini" and unfortunately it only returns the posts in this thread here.
Logged
Customers
Full Member
*

Karma: 0
Posts: 67


Email
Reply #6 on: Feb 13, 10, 11:15 PM

Sergey:

The solution to this timeout problem is to add this before line 52 of mochiimporter.php :

set_time_limit(n);

Where n is # of seconds to use as new value superceding max_execution_time

What webmasters should be aware of is that your website will become unresponsive to all your visitors until the importer is finished. So for example, putting  set_time_limit(60); will make your site unresponsive for an entire minute but the importer will being "working" during that time.

Logged
Administrator
Sr. Member
*

Karma: 7
Posts: 486


Email
Reply #7 on: Feb 14, 10, 12:35 AM

The solution to this timeout problem is to add this before line 52 of mochiimporter.php :
set_time_limit(n);

you can try that, but most likely (i.e. on most hosts) it will not help, please read the function description and especially comments about its working on different environments at http://php.net/manual/en/function.set-time-limit.php
Logged
Customers
Full Member
*

Karma: 0
Posts: 67


Email
Reply #8 on: Feb 14, 10, 12:55 AM

I posted this solution because it works for my hosting. (Tested it with a set time of 60 and the Mochi importer reported timing out after 60 seconds. Previously, the default was 28 seconds).

Logged
Pages: [1]
 
Jump to: