perf(backup): extend backup restore and conversion timeout to 1 hour (3600s)

This commit is contained in:
Ray1111-aa
2026-11-03 13:34:07 +07:00
parent 61332f948b
commit a55ead4c5b
5 changed files with 21 additions and 21 deletions
+2 -2
View File
@@ -149,7 +149,7 @@ class DatabaseBackupService
*/
public function createKmhBackup(?array $selectedTables = null, bool $includeMedia = false, ?string $customFilename = null): string
{
@set_time_limit(1800);
@set_time_limit(3600);
@ini_set('memory_limit', '1024M');
if (!class_exists('ZipArchive')) {
@@ -242,7 +242,7 @@ class DatabaseBackupService
*/
public function restore(string $backupFilenameOrPath): void
{
@set_time_limit(1800);
@set_time_limit(3600);
@ini_set('memory_limit', '1024M');
$filePath = File::exists($backupFilenameOrPath)
+7 -7
View File
@@ -32,7 +32,7 @@ class KmhConverterService
*/
public function inspectServerFile(string $filename): array
{
@set_time_limit(1800);
@set_time_limit(3600);
@ini_set('memory_limit', '1024M');
$backupDir = $this->backupService->getBackupDirectory();
@@ -82,9 +82,9 @@ class KmhConverterService
$tempDir = storage_path('app/temp_converter');
File::ensureDirectoryExists($tempDir);
// Bersihkan file sementara yang lebih tua dari 30 menit
// Bersihkan file sementara yang lebih tua dari 1 jam (3600 detik)
foreach (File::files($tempDir) as $f) {
if ((time() - $f->getMTime()) > 1800) {
if ((time() - $f->getMTime()) > 3600) {
@unlink($f->getPathname());
}
}
@@ -128,7 +128,7 @@ class KmhConverterService
*/
public function inspectUploadedFile(UploadedFile $file): array
{
@set_time_limit(1800);
@set_time_limit(3600);
@ini_set('memory_limit', '1024M');
$realPath = $file->getRealPath();
@@ -180,9 +180,9 @@ class KmhConverterService
$tempDir = storage_path('app/temp_converter');
File::ensureDirectoryExists($tempDir);
// Bersihkan file sementara yang lebih tua dari 30 menit
// Bersihkan file sementara yang lebih tua dari 1 jam (3600 detik)
foreach (File::files($tempDir) as $f) {
if ((time() - $f->getMTime()) > 1800) {
if ((time() - $f->getMTime()) > 3600) {
@unlink($f->getPathname());
}
}
@@ -259,7 +259,7 @@ class KmhConverterService
*/
public function convertKmhFilePath(string $kmhFilePath, string $originalFilename, array $selectedTables, string $format): array
{
@set_time_limit(1800);
@set_time_limit(3600);
@ini_set('memory_limit', '1024M');
$format = strtolower($format);