nao-pon/flysystem-google-drive

Cache issue when using background job.

coupej opened this issue · 0 comments

Similar with #53 is have an issue with the caching mechanisme that is used.

So i have long running background job for creating the documents and a different real time job for deleting the created files.

If I want to recreate a file on the same location the cache retrieves the old file instead of a new one and fails because the file doesn't exist anymore.

I can restart my background job and it will work again, but that is no way to live.

I could fix it with a custom method in the adapter that clears the cache like this:

public function clearcache() { $this->cacheHasDirs = []; $this->cacheFileObjects = []; $this->cacheFileObjectsByName = []; }
and call it when I want to upload the file again.

Storage::disk($diskName)->getDriver()->getAdapter()->clearcache();

Would you be willing to add such a pull request? Or would you prefer a different way to solve this problem?