Giter Club home page Giter Club logo

Comments (5)

mickeyfmann avatar mickeyfmann commented on June 9, 2024 1

A bit of an update, @xicond your type casting comment gave me something to look at here. I delved a bit deeper to find that the issue is with the cache loader. I still haven't been able to reproduce the issue organically, but my assumption at this point is that there's a corner case just when the cache is about to expire where the cache loader check passes but the retrieval fails. Since they're returning from the tagged cache repository directly that result can be null. Regardless of how the issue is happening the problem definitely is the cache loader returning null values in some instances.

With this in mind, this gives us two options for a resolution. The first would be to disable caching via the package's config file. This will solve the issue but I was concerned with potential performance implications from this solution. So I decided to take a different path by overriding the cache loader as well as their service provider so that I could insert my custom cache loader into the mix. The only real change to the cache loader is some additional checks to ensure that the value its returning is an array. If not, it will just rely on the fallback option of the file loader again and repopulate the cache. Additionally, I'm increasing the cache time out value to 24 hours to reduce the frequency of this happening. Increasing the cache expiration settings, may not work in all cases if you're using database mode or other methods to update your content. In my case, we're running in file only mode and our deployment scripts are programmed to flush the translation cache anyways.

It should be pointed out that these are only temporary solutions, its pretty obvious at this point that this library is no longer maintained. Long term I'm going to be either looking to replace it or see if it's even necessary anymore with the improvements Laravel has made to their translation support.

from translation.

bilalaslam777 avatar bilalaslam777 commented on June 9, 2024

@mickeyfmann i am facing the same problem. Can you please share the solution if you found any?

from translation.

xicond avatar xicond commented on June 9, 2024

happen on me

this library suppose cast to array when loadSource not found or null

I'm searching another library

from translation.

mickeyfmann avatar mickeyfmann commented on June 9, 2024

Unfortunately I've still not found a solution to this. I'm not able to reproduce the issue in any manual fashion, so its really hard for me to pinpoint. @bilalaslam777 @xicond , if you've encountered these issues perhaps its worth posting some more details about your setup and configuration around the library.

As I stated, our setup is running in file only mode. Our servers are provisioned with Laravel Forge and we're using the local Redis instances from that for data caching. Session data is stored on a remote Redis server, but nothing related to this should be stored there.

from translation.

krychu90 avatar krychu90 commented on June 9, 2024

I have the same problem. Random errors on production.

from translation.

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.