Yii operations not working as expected

I am currently trying to do custom operations to execute processes (especially long queries) without waiting for the user. So I followed the runactions documentation . And he says below should work. The insert statement must work while the action continues anyway.

public function actionLongProcess(){

        if(ERunActions::runBackground()){
             $sql = <<<EOD
                   insert into public.test (value) VALUES ('hehe')                              
EOD;
             Yii::app()->db->createCommand($sql)->execute();

        }else{
                ChromePhp::log('hello');
        }
}

      

Unfortunately this doesn't happen and I don't know why, only the other part is done. kindly clueless here.

+3


source to share


1 answer


This extension is a helper class for triggering actions. This makes controller actions repeatable in different contexts.

Features:

Running controller actions as background tasks

Set up cron jobs

"Tap" URLs on remote / local servers.

Run pre-configured batch or php scripts



Use the built-in Http client for simple GET and POST requests (since 1.1)

Interval filter for controller actions (since version 1.1)

Requirements

Developed with Yii 1.1.7

When using 'touchUrlExt' (see below) you need to install the ehttpclient extension

0


source







All Articles