This is an odd one and, to be honest, I'm not even sure if this is the right place for this but it seems the most relevant.
I am using this package with Laravel 5.0.
I have a command that handles files stores on s3. Using Laravel's FileSystem(FlySystem) with this package I obtain a file from s3:
$s3Disk->get($fileLocation)
The returned value of this method is a string filepath to private/var/temp/xxxxx
, which is the location of the file contents obtained from s3.
This works as expected when my app is running synchronously and the command is executed when it is invoked, however when I use queued commands and instead execute these commands from a listener I get different behavior from FlySystem.
When run on a listener $s3Disk->get($fileLocation)
still returns a filepath but the file does not exist.
In case you are not familiar with Laravel's commands/queues the code that is being executed in context to FlySystem (in the command) is identical -- it doesn't matter if it's synchronous or run by a listener after fetching it from a queue, it's all the same code in a handle()
method in the command.
Can anyone provide any insight into why this might happen?
I have a hunch that it is caused by the context the application is running in (single process, synchronous request vs. listener where the app is a child process?) and somehow temporary files are being cleaned up immediately after creation but I really have no idea.