mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 02:47:34 -05:00 
			
		
		
		
	Fixes for invoking Public filesystem driver unnecessarily
This commit is contained in:
		
							parent
							
								
									cb07c1df9c
								
							
						
					
					
						commit
						47be74321c
					
				@ -3,6 +3,7 @@
 | 
			
		||||
namespace App\Console\Commands;
 | 
			
		||||
 | 
			
		||||
use App\Models\Company;
 | 
			
		||||
use App\Utils\Ninja;
 | 
			
		||||
use Illuminate\Console\Command;
 | 
			
		||||
use Illuminate\Support\Facades\Storage;
 | 
			
		||||
 | 
			
		||||
@ -42,6 +43,10 @@ class S3Cleanup extends Command
 | 
			
		||||
    public function handle()
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        if(!Ninja::isHosted())
 | 
			
		||||
            return;
 | 
			
		||||
        
 | 
			
		||||
        $c1 = Company::on('db-ninja-01')->pluck('company_key');
 | 
			
		||||
        $c2 = Company::on('db-ninja-02')->pluck('company_key');
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -42,8 +42,5 @@ class DiskCleanup implements ShouldQueue
 | 
			
		||||
        $files = Storage::allFiles(config('filesystems.default'), 'backups/');
 | 
			
		||||
        Storage::delete($files);
 | 
			
		||||
 | 
			
		||||
        $files = Storage::allFiles('public', 'backups/');
 | 
			
		||||
        Storage::delete($files);
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user