Coder Social home page Coder Social logo

Comments (22)

bkuhl avatar bkuhl commented on August 26, 2024

The error is coming from a dependency of Dispatcher. Can you post your schedule() that is throwing this error?

from dispatcher.

bkuhl avatar bkuhl commented on August 26, 2024

It looks like there also might be an issue with a dependency here. The stack trace shows Indatus\\Diipatt..., whereas the namespace of this package is Indatus\Dispatcher

from dispatcher.

dwightwatson avatar dwightwatson commented on August 26, 2024

Apologies, I was without a computer over the weekend.

Here are the registered schedule methods, I will try disabling them all and then re-enabling them one by one to see if that changes anything. Note that these are all from different commands.

/**
 * When a command should run.
 *
 * @param Scheduler $scheduler
 * @return \Indatus\Dispatcher\Scheduling\Schedulable
 */
public function schedule(Schedulable $scheduler)
{
    // Run on Friday at 9am.
    return $scheduler->daysOfTheWeek(Scheduler::FRIDAY)->hours(9)->minutes(0);
}

/**
 * When a command should run.
 *
 * @param Scheduler $scheduler
 * @return \Indatus\Dispatcher\Scheduling\Schedulable
 */
public function schedule(Schedulable $scheduler)
{
    // Run every day at 9am.
    return $scheduler->daily()->hours(9)->minutes(0);
}

/**
 * When a command should run.
 *
 * @param Scheduler $scheduler
 * @return \Indatus\Dispatcher\Scheduling\Schedulable
 */
public function schedule(Schedulable $scheduler)
{
    // Run every day at 3am.
    return $scheduler->opts([
            'count' => 5000
        ])->daily()
        ->hours(3)
        ->minutes(0);
}

/**
 * When a command should run.
 *
 * @param Scheduler $scheduler
 * @return \Indatus\Dispatcher\Scheduling\Schedulable
 */
public function schedule(Schedulable $scheduler)
{
    // Run every day at 3am.
    return $scheduler->daily()->hours(3)->minutes(0);
}

from dispatcher.

dwightwatson avatar dwightwatson commented on August 26, 2024

I disabled all the commands (using isEnabled(), if that makes a difference or not) and am still seeing the same issue. Might I need to actually remove the other commands/unregister them from Artisan and test again?

from dispatcher.

bkuhl avatar bkuhl commented on August 26, 2024

If you could try unregistering them one by one that would be great. Is this running on Windows or Linux?

If you could also verify the imports on your commands by looking for Indatus\\Diipatt to figure out where that's coming from as well.

from dispatcher.

dwightwatson avatar dwightwatson commented on August 26, 2024

Will do, I'll do it tomorrow when I'm back at work. This is running on a Linux machine, using cPanel.

I'll double-check the imports as well. To be honest, I actually saw an example recently with some other code where the namespace was being all skewed, I never discovered why but it was unrelated to the problem. Really curious.

from dispatcher.

bkuhl avatar bkuhl commented on August 26, 2024

Did you have a chance to review this?

from dispatcher.

dwightwatson avatar dwightwatson commented on August 26, 2024

Apologies, was out of town for the remainder of the week. I'm going to try again by unregistering the commands one by one tomorrow and will report back.

from dispatcher.

bkuhl avatar bkuhl commented on August 26, 2024

Any luck on the source of the issue?

from dispatcher.

erixx104 avatar erixx104 commented on August 26, 2024

I have the same error, mentioned above ('Use of undefined constant STDOUT - assumed 'STDOUT'), if I perform ANY Artisan:call('XY') from somewhere in my application. Everything goes fine if I remove Indatus/Dispatcher from composer.json and the ServiceProvider from the providers-array.

I've tested it with a newly created and empty artisan command.

Any idea?

from dispatcher.

DGTnt avatar DGTnt commented on August 26, 2024

For those who're still suffering.. I was able to solve that Issue by putting those queue's inside the cron manually. I've been suffering that issue each time when I made artisan following up the queue untill I decided to make the queue's run by cron.

Somehow or something is blocking that php shell to act with the terminal which provides the error. When manually steering the queue via cron, it doesn't happens.

from dispatcher.

bkuhl avatar bkuhl commented on August 26, 2024

PHP only defines STDOUT when being run in cli. Seeing as Artisan::call() is likely not being executed via cli I think that makes sense. This error is coming from the php-cli dependency that Dispatcher only uses in the Cron driver when printing a cron summary: https://github.com/Indatus/dispatcher/blob/master/src/Indatus/Dispatcher/Drivers/Cron/ScheduleService.php . Are you running Artisan::call() on a command scheduled with dispatcher?

It'd be helpful to see a project where this error occurs. Is it possible for you to grant me access or send some source code privately via email?

from dispatcher.

erixx104 avatar erixx104 commented on August 26, 2024

I've just sent you an email with the url.
Thx for help.

from dispatcher.

bkuhl avatar bkuhl commented on August 26, 2024

I haven't received that email.

from dispatcher.

erixx104 avatar erixx104 commented on August 26, 2024

Then I've got the wrong address. I took the one, mentioned at the end of the instruction slides.

from dispatcher.

bkuhl avatar bkuhl commented on August 26, 2024

Indatus is in the process of moving some servers this weekend which may be
affecting my email. Can you send it to [email protected] ?

On Sat, Jul 12, 2014 at 2:00 PM, erixx104 [email protected] wrote:

Then I've got the wrong address. I took the one, mentioned at the end of
the instruction slides.


Reply to this email directly or view it on GitHub
#42 (comment).

Ben Kuhl

from dispatcher.

bkuhl avatar bkuhl commented on August 26, 2024

I've submitted a pull request to php-cli-tools to resolve this: wp-cli/php-cli-tools#57

from dispatcher.

bkuhl avatar bkuhl commented on August 26, 2024

I've pushed an update to the develop branch that I believe will resolve this. Please update your composer to use this branch and see how that works for you.

b31007b

from dispatcher.

erixx104 avatar erixx104 commented on August 26, 2024

Your update works. Artisan::call() works without problems. Scheduled Jobs still running. Everything seems to be fine to me!

from dispatcher.

bkuhl avatar bkuhl commented on August 26, 2024

Excellent! Since several of you guys were having this issue, can I get a 2nd confirmation from someone that this resolves the issue?

from dispatcher.

spamoom avatar spamoom commented on August 26, 2024

I can confirm this has been fixed in the develop branch

from dispatcher.

bkuhl avatar bkuhl commented on August 26, 2024

Thanks!

Issue is resolved with the latest release: https://github.com/Indatus/dispatcher/releases/tag/v1.3.1

from dispatcher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.