fix: fix issue with run cronjob failed (#8082)

This commit is contained in:
zhengkunwang 2025-03-06 16:24:43 +08:00 committed by GitHub
parent e4c096295f
commit 9c238ce7aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 10 additions and 23 deletions

View file

@ -184,7 +184,7 @@ func handleWebsiteRecover(website *model.Website, recoverFile string, isRollback
}
taskName := i18n.GetMsgByKey("TaskRecover") + i18n.GetMsgByKey("websiteDir")
t.Log(taskName)
if err = fileOp.TarGzExtractPro(fmt.Sprintf("%s/%s.web.tar.gz", tmpPath, website.Alias), GetSitePath(*website, SitesDir), secret); err != nil {
if err = fileOp.TarGzExtractPro(fmt.Sprintf("%s/%s.web.tar.gz", tmpPath, website.Alias), GetOpenrestyDir(SitesRootDir), secret); err != nil {
t.LogFailedWithErr(taskName, err)
return err
}

View file

@ -342,11 +342,7 @@ func handleBackupLogs(targetDir, fileName string, secret string) error {
return err
}
if len(websites) != 0 {
nginxInstall, err := getAppInstallByKey(constant.AppOpenresty)
if err != nil {
return err
}
webItem := path.Join(nginxInstall.GetPath(), "www/sites")
webItem := GetOpenrestyDir(SitesRootDir)
for _, website := range websites {
dirItem := path.Join(targetDir, "website", website.Alias)
if _, err := os.Stat(dirItem); err != nil && os.IsNotExist(err) {

View file

@ -181,12 +181,8 @@ func (u *CronjobService) handleCutWebsiteLog(cronjob *model.Cronjob, startTime t
msgs []string
)
websites := loadWebsForJob(*cronjob)
nginx, err := getAppInstallByKey(constant.AppOpenresty)
if err != nil {
return msgs, "", nil
}
baseDir := pathUtils.Join(nginx.GetPath(), "www", "sites")
fileOp := files.NewFileOp()
baseDir := GetOpenrestyDir(SitesRootDir)
for _, website := range websites {
websiteLogDir := pathUtils.Join(baseDir, website.Alias, "log")
srcAccessLogPath := pathUtils.Join(websiteLogDir, "access.log")

View file

@ -1161,7 +1161,6 @@ const (
SiteErrorLog = "error.log"
WebsiteRootDir = "WebsiteRootDir"
SiteDir = "SiteDir"
SitesDir = "SitesDir"
SiteIndexDir = "SiteIndexDir"
SiteProxyDir = "SiteProxyDir"
SiteSSLDir = "SiteSSLDir"
@ -1186,8 +1185,6 @@ func GetSitePath(website model.Website, confType string) string {
return path.Join(GteSiteDir(website.Alias), "log", "error.log")
case SiteDir:
return GteSiteDir(website.Alias)
case SitesDir:
return path.Join(GetWebSiteRootDir(), "sites")
case SiteIndexDir:
return path.Join(GteSiteDir(website.Alias), "index")
case SiteCacheDir:

View file

@ -1,6 +0,0 @@
package qqwry
import _ "embed"
//go:embed qqwry.dat
var QQwryByte []byte

Binary file not shown.

View file

@ -93,7 +93,7 @@
<el-form-item
:label="getLabel(formFields['CONTAINER_PACKAGE_URL'])"
:rules="rules.params.CONTAINER_PACKAGE_URL"
v-if="formFields['CONTAINER_PACKAGE_URL']"
v-if="runtime.params['PHP_VERSION'] != '5.6.40' && formFields['CONTAINER_PACKAGE_URL']"
>
<el-select v-model="runtime.source" filterable default-first-option>
<el-option

View file

@ -40,7 +40,7 @@ import { Rules } from '@/global/form-rules';
import { computed, onMounted, reactive, ref } from 'vue';
import { FormInstance } from 'element-plus';
import i18n from '@/lang';
import { MsgSuccess } from '@/utils/message';
import { MsgError, MsgSuccess } from '@/utils/message';
import { getAgentGroupList } from '@/api/modules/group';
import { Group } from '@/api/interface/group';
@ -75,6 +75,10 @@ const submit = async (formEl: FormInstance | undefined) => {
if (!valid) {
return;
}
if (form.remark && form.remark.length > 128) {
MsgError(i18n.global.t('commons.rule.length128Err'));
return;
}
loading.value = true;
updateWebsite(form)
.then(() => {

View file

@ -156,7 +156,7 @@
<template #default="{ row }">
<fu-read-write-switch>
<template #read>
<MsgInfo :info="row.remark" width="180px" />
<MsgInfo :info="row.remark" :width="'280'" />
</template>
<template #default="{ read }">
<el-input v-model="row.remark" @blur="updateRemark(row, read)" />