PHP Fatal error: Maximum execution time of 120 seconds exceeded in /var/www/domainname.com/public/includes/database/select.inc on line 1309
I have an elysia cron command that takes perhaps 10-15 minutes, in the night. The script also starts some jobs with beanstalk, so it takes a while to execute.
When it runs automatically at night I get that above error message. It doesnt make sense, because when I run the command from the terminal it works:
drush elysia-cron run elysia_cron_job_name --verbose --ignore-disable --ignore-running --ignore-time
And on line 1309 in select.inc is this:
public function addField($table_alias, $field, $alias = NULL) {
// If no alias is specified, first try the field name itself.
if (empty($alias)) {
$alias = $field;
}
// If that's already in use, try the table name and field name.
if (!empty($this->fields[$alias])) {
$alias = $table_alias . '_' . $field;
}
// If that is already used, just add a counter until we find an unused alias.
$alias_candidate = $alias;
$count = 2;
while (!empty($this->fields[$alias_candidate])) {
$alias_candidate = $alias . '_' . $count++;
}
$alias = $alias_candidate;
$this->fields[$alias] = array(
'field' => $field,
'table' => $table_alias,
'alias' => $alias,
);
return $alias;
}
Exactly 1309 is: 'table' => $table_alias,
I've searched the web, and I have no idea where the 120 seconds comes from. I feel like I tried everything. Can someone help?