public function deleteOldFiles(Filesystem $filesystem, string $path, int $max_age): void
    {
        $list = $filesystem->listContents($path, true);

        $timestamp = Carbon::now()->unix();

        foreach ($list as $metadata) {
            if ($metadata['timestamp'] ?? $timestamp < $timestamp - $max_age) {
                $this->deleteFileOrFolder($filesystem, $metadata['path']);
            }
        }
    }