fix: 定时任务修复+管理后台Task7支持 (Task4外键修复, Task7管理员邮箱动态查询, Task5限流防护, Task7加入SCRIPT_MAP)
This commit is contained in:
@@ -3,7 +3,7 @@ import { PrismaMariaDb } from "@prisma/adapter-mariadb";
|
||||
import { Octokit } from "octokit";
|
||||
import "dotenv/config";
|
||||
|
||||
const base = process.env.DATABASE_URL || "mysql://localhost:3306/zhuiguang_ai?charset=utf8mb4";
|
||||
const base = (process.env.DATABASE_URL || "mysql://localhost:3306/zhuiguang_ai?charset=utf8mb4").replace("mysql://", "mariadb://");
|
||||
const sep = base.includes("?") ? "&" : "?";
|
||||
const connectionString = `${base}${sep}connection_limit=20&pool_timeout=30`;
|
||||
const adapter = new PrismaMariaDb(connectionString);
|
||||
@@ -47,6 +47,7 @@ async function main() {
|
||||
}
|
||||
|
||||
try {
|
||||
await new Promise((r) => setTimeout(r, 300));
|
||||
const { data } = await octokit.rest.repos.get({ owner: parsed.owner, repo: parsed.repo });
|
||||
const currentStars = data.stargazers_count;
|
||||
|
||||
@@ -92,10 +93,6 @@ async function main() {
|
||||
errors.push(`${skill.name}: ${e.message}`);
|
||||
console.log(` ❌ ${skill.name}: ${e.message}`);
|
||||
}
|
||||
|
||||
if (updated % 5 === 0) {
|
||||
await new Promise((r) => setTimeout(r, 1000));
|
||||
}
|
||||
}
|
||||
|
||||
const endTime = new Date();
|
||||
|
||||
Reference in New Issue
Block a user