27 lines
985 B
Diff
27 lines
985 B
Diff
# UNDF: UNDF-2026-000001102
|
|
--- a/app/Console/Commands/S3Cleanup.php
|
|
+++ b/app/Console/Commands/S3Cleanup.php
|
|
@@ -55,17 +55,19 @@ 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');
|
|
$c3 = Company::on('db-ninja-03')->pluck('company_key');
|
|
|
|
- $merged = $c1->merge($c2)->merge($c3)->toArray();
|
|
+ $merged = array_flip($c1->merge($c2)->merge($c3)->toArray());
|
|
|
|
$directories = Storage::disk(config('filesystems.default'))->directories();
|
|
|
|
$this->LogMessage('Disk Cleanup');
|
|
|
|
foreach ($directories as $dir) {
|
|
- if (! in_array($dir, $merged)) {
|
|
+ if (! isset($merged[$dir])) {
|
|
$this->logMessage("Deleting $dir");
|
|
|
|
/* Ensure we are not deleting the root folder */
|