no message

This commit is contained in:
kuaifan 2025-05-15 15:39:03 +08:00
parent 7be1171004
commit 12ecf4de40
2 changed files with 16 additions and 2 deletions

View File

@ -6,6 +6,7 @@ use App\Models\User;
use App\Module\Apps\Apps;
use App\Module\Base;
use App\Module\Timer;
use Cache;
use Request;
/**
@ -98,7 +99,16 @@ class AppsController extends AbstractController
User::auth();
//
$appName = Request::input('app_name');
return Apps::getAppEntryPoints($appName);
//
$cacheKey = 'apps_entry:' . $appName;
$cacheData = Cache::remember($cacheKey, now()->addHour(), function () use ($appName) {
return Apps::getAppEntryPoints($appName);
});
if (Base::isError($cacheData)) {
Cache::forget($cacheKey);
}
//
return $cacheData;
}
/**

View File

@ -177,6 +177,10 @@ class Apps
*/
public static function dockerComposeFinalize(string $appName, string $status): array
{
// 清理入口缓存
Cache::forget('apps_entry:' . $appName);
Cache::forget('apps_entry:');
// 获取当前应用信息
$appInfo = self::getAppConfig($appName);
@ -394,7 +398,7 @@ class Apps
{
$allEntryPoints = [];
$baseDir = base_path('docker/appstore/apps');
if (!is_dir($baseDir)) {
return Base::retSuccess("success", $allEntryPoints);
}