Giter Club home page Giter Club logo

Comments (6)

adrenth avatar adrenth commented on June 20, 2024

Fixed in 2.5.7

from oc-redirect-plugin.

ericp-mrel avatar ericp-mrel commented on June 20, 2024

Looks like this is still an issue after running the october:up command as it clears the cache using the Cache facade Cache::flush() and it looks like the cache:cleared event doesn't get triggered when doing that. The cache:cleared event only gets dispatched when running the cache:clear command.

https://github.com/octobercms/october/blob/1.1/modules/system/classes/UpdateManager.php#L158
https://github.com/octobercms/october/blob/1.1/modules/system/helpers/Cache.php#L15-L19

from oc-redirect-plugin.

adrenth avatar adrenth commented on June 20, 2024

I thought I had it covered by just listen to a specific event... Will look for a better solution.

from oc-redirect-plugin.

ericp-mrel avatar ericp-mrel commented on June 20, 2024

Yeah, that's the first path I took when I was looking at making a fix for this issue as well which is why I landed on checking if the cache has the key before getting the rules. Not sure if there's a better way that you can think of that doesn't require checking the cache key exists every time.

from oc-redirect-plugin.

ericp-mrel avatar ericp-mrel commented on June 20, 2024

Something that could work is listening for the CommandFinished event and if the command name is october:up or winter:up then publish the redirects.

Event::listen(CommandFinished::class, static function (CommandFinished $commandFinished): void {
    if (in_array($commandFinished->command, ['october:up', 'winter:up'])) {
        /** @var PublishManagerInterface $publishManager */
        $publishManager = resolve(PublishManagerInterface::class);
        $publishManager->publish();
    }
});

from oc-redirect-plugin.

adrenth avatar adrenth commented on June 20, 2024

I'm sure that won't cover all the situations which can occur when the cache is empty/invalidated or emptied somewhere else. I did use your solution and I have added it to 2.5.8.

from oc-redirect-plugin.

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.