Giter VIP home page Giter VIP logo

kirby-queue's People

Contributors

bvdputte avatar teichsta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

kirby-queue's Issues

Trouble with jobs

Hello,

I tried to follow the instructions although I got a bit confused on how to correctly set this up.

So basically I'm trying to set a cron that hits this url: mydomain.com/gcapc/push every hour, but I'm unsure on where I should write that code. Is it on the config.php file or do I need to create it on a separate folder under site/queues? (I'm using the Poor man's cron option by the way)

I Appreciate any help, thank you!

PMC bugs

hello,

i am using php 8.1 and kirby 3.8 (dont know if other versions are behaving the same way) and i found that, that the cron function was not working for me:

if (option("bvdputte.kirbyqueue.poormanscron")) {
    $root = kirby()->roots()->site() . '/' . option("bvdputte.kirbyqueue.root");
    $pmcFile = $root . "/.pmc";

    if (!f::exists($pmcFile)) f::write($pmcFile, time());
    $nextRun = f::read($pmcFile) + option("bvdputte.kirbyqueue.poormanscron.interval");

    if( $nextRun < time() ) {
        // Work the queue
        bvdputte\kirbyQueue\Queueworker::work();
        f::write($pmcFile, time());
    }
}

after changing

option("bvdputte.kirbyqueue.root");

to

kirby()->option("bvdputte.kirbyqueue.root");

it started working. so technically the complete IF looks like this:

if (option("bvdputte.kirbyqueue.poormanscron")) {
    $root = kirby()->roots()->site() . '/' . kirby()->option("bvdputte.kirbyqueue.root");
    $pmcFile = $root . "/.pmc";

    if (!f::exists($pmcFile)) f::write($pmcFile, time());
    $nextRun = f::read($pmcFile) + kirby()->option("bvdputte.kirbyqueue.poormanscron.interval");

    if( $nextRun < time() ) {
        // Work the queue
        bvdputte\kirbyQueue\Queueworker::work();
        f::write($pmcFile, time());
    }
}

also, I had to set these options inside the plugin index.php, otherwise from the config.php it was not working either. strangely enough, the 'worker.route' works from the config, but i guess it is because it is called later?

options i had to set in index of plugin

'poormanscron' => true,
'poormanscron.interval' => 30, // in seconds

Problem with Kirby > 3.6.2 and PHP 8.1

The bvdputte\kirbyQueue\Job::get() method does not seem to be compatible with Kirby\Toolkit\Obj::get()

Declaration of bvdputte\kirbyQueue\Job::get(string $key, $default = null) must be compatible with Kirby\Toolkit\Obj::get($property, $fallback = null)

Job search helpers

Add search methods on the queue class to search for jobs (id / data keys)

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.