Skip to content

Use with Laravel Octane and Horizon #79

Discussion options

You must be logged in to vote

For anyone else looking into this -- I haven't implemented Octane yet with Spatie Once, but I believe we should be able to add a OperationTerminated listener to Laravel Octane's config to flush Spatie Once's cache:

https://github.com/laravel/octane/blob/bcd6ffe87bd389890fd7ef8ac24b46c579c8b434/config/octane.php#L103-L107

// config/octane.php

OperationTerminated::class => [
    FlushTemporaryContainerInstances::class,
    // DisconnectFromDatabases::class,
    // CollectGarbage::class,

    FlushSpatieOnce::class, // <-- Here
],
// app/Listeners/FlushSpatieOnce.php

use Spatie\Once\Cache;

class FlushSpatieOnce
{
    /**
     * Handle the event.
     *
     * @param  mixed  $event
     * …

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@robertpcontreras-ts
Comment options

@tm1000
Comment options

Answer selected by freekmurze
Comment options

You must be logged in to vote
1 reply
@freekmurze
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants