wa0x6e / Cake-Resque

Resque plugin for CakePHP : for creating background jobs that can be processed offline later
MIT License
159 stars 56 forks source link

Path to shell method #16

Closed ddaattttaa closed 11 years ago

ddaattttaa commented 11 years ago

Hello,

The path to call my method in the shell file is in the core path ? not in my app. I change this path in the method createJob but i always the problem. My CAKE_CORE_INCLUDE_PATH is lib/version/2.2/Cake is it a error ?

Thank you

wa0x6e commented 11 years ago

Can you develop more ? I don't quite understand your problem

On Thursday, February 7, 2013, yabanga wrote:

Hello,

The path to call my method in the shell file is in the core path ? not in my app. I change this path in the method createJob but i always the problem. My CAKE_CORE_INCLUDE_PATH is lib/version/2.2/Cake is it a error ?

Thank you

— Reply to this email directly or view it on GitHubhttps://github.com/kamisama/Cake-Resque/issues/16.

ddaattttaa commented 11 years ago

My CAKE_CORE_INCLUDE_PATH is lib/version/2.2/Cake But when start a job, it is fail because the find path is app/lib/version/Cake example : [2013-02-07 23:02:12] main.ERROR: {"queue":"default","id":"d2903262d79c31cf64fcc49b8f30f378","class":"EmailShell","args":[["register",5403]]} failed: Could not find job class /Users/foo/Sites/bar/html/lib/version/app/Console/Command/EmailShell.php. {"type":"fail","log":"Could not find job1 class /Users/foo/Sites/bar/html/lib/version/app/Console/Command/EmailShell.php.","job_id":"d2903262d79c31cf64fcc49b8f30f378","time":0,"worker":"dAttA.local:77055"} []

Now if i change my CAKE_CORE_INCLUDE_PATH for origin path all it is ok.

wa0x6e commented 11 years ago

And in which file do you change the CAKE_CORE_INCLUDE_PATH ?

ddaattttaa commented 11 years ago

In index.php to the root directory

wa0x6e commented 11 years ago

So yes, you should also change the CAKE_CORE_INCLUDE_PATH in CakeResque/Lib/CakeResqueBootstrap.php

You should probably change it in somewhere else too, to make the regular shell working.

Although I recommend that you don't touch this variable, and just make a symlink.

ddaattttaa commented 11 years ago

Thank you. On my server i have create a symlink :), very more easy.

Now when i start the worker, i have always fail response and no log ? If i lauch this command bash -c "VVERBOSE=1 QUEUE=default COUNT=2 php resque.php" in the folder php-resque-ex/bin the worker work well

While on my laptop all is ok.

wa0x6e commented 11 years ago

no log ? there's nothing in both logs ? What's your server OS ?

ddaattttaa commented 11 years ago

Yes, nothing my OS is Debian.

Where is defined the runtime user ?

wa0x6e commented 11 years ago

in the bootstrap :

'Worker' => array(
        'queue' => 'default',       // Name of the default queue
        'interval' => 5,            // Number of second between each poll
        'workers' => 1,             // Number of workers to create
                    'user' => 'you-user'

It was not in the original documentation, I'll update it later. You can also specify the user by passing -u username when starting the workers with cake start

ddaattttaa commented 11 years ago

it is finally this is what I do . Thank you for your great plugin ;)