Hello,
Im getting this error "General error: 2006 MySQL server has gone away" when saving a object.
Im not going to paste the code since it way too complicated and I can explain with this example, but first a bit of context:
Im executing a function via Command line using Phalcon tasks, this task creates a Object from a Model class and that object calls a casperjs script that performs some actions in web page, when it finishes its save some data, here's where sometimes I get mysql server has gone away, only when the casperjs takes a bit more.
Task.php
function doSomeAction(){
$object = Class::findFirstByName("test");
$object->performActionOnWebPage();
}
In Class.php
function performActionOnWebPage(){
$anotherObject = AnotherClass::findFirstById($anId);
$result = exec ("timeout 30s casperjs somescript.js");
if($result){
$anotherObject->value = $result->value;
$anotherObject->save();
}
}
It seems like the save method is affected by the time exec ("timeout 30s casperjs somescript.js"); takes to get an answer, when it shouldnt.
Any explanation to this behaviour?