Fix: Clear mux directory

This commit is contained in:
peaklabs-dev 2024-09-17 15:57:57 +02:00
parent 42ff7b19a4
commit d13e2c0865
No known key found for this signature in database

View file

@ -4,13 +4,16 @@
use Illuminate\Support\Facades\Storage;
use App\Models\PrivateKey;
class PopulateSshKeysDirectory extends Migration
class PopulateSshKeysAndClearMuxDirectory extends Migration
{
public function up()
{
Storage::disk('ssh-keys')->deleteDirectory('');
Storage::disk('ssh-keys')->makeDirectory('');
Storage::disk('ssh-mux')->deleteDirectory('');
Storage::disk('ssh-mux')->makeDirectory('');
PrivateKey::chunk(100, function ($keys) {
foreach ($keys as $key) {
$key->storeInFileSystem();