chore(清理): 删掉并行试跑、搬库、Python3 别名、旧链接这些过渡期的兼容写法
Deploy / deploy (push) Canceled after 0s

- 部署:JUDGE_STATE_DIR 不再强制设;删掉搬库脚本和只为搬库存在的自检、提醒
- 语言:Python3 / Python2 别名表删掉,normalizeLanguage 改名 parseLanguage
- 旧链接:后台题单详情的跳转、用户列表 -last_login 的转换
- 旧页面:布置作业必须带 language(null = 没选);不再清旧版出题页草稿

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-10-26 14:15:04 +08:00
1 parent 9e074f3ab8
commit 8427475337
23 files changed
+47 -386

No files matched your search

+2 -8
View File
@@ -6,8 +6,6 @@
* 所以内存态够用,不需要 Redis 同步。进程重启丢掉全部状态,两端重连后回到干净状态。
*/
import { normalizeLanguage } from '@oj2/contract'
export type CollabSocket = Bun.ServerWebSocket<import('../websocket').SubmissionSocketData>
/**
@@ -19,14 +17,10 @@ export const COLLAB_LANGUAGES = ['C', 'C++', 'Python', 'Java', 'JavaScript', 'Go
export type CollabLanguage = (typeof COLLAB_LANGUAGES)[number]
/**
* 认不出来的一律当 C:老客户端不带这个字段,而它以前就是写死 C 的。
*
* 先过契约的别名表 —— 上线那一刻学生页面里还揣着 `Python3`,不翻译的话会**静默**
* 落到 C,求助窗口里的代码高亮和同步编辑都按 C 走,没人会报错。
* 认不出来的一律当 C。
*/
export function normalizeCollabLanguage(value: unknown): CollabLanguage {
const normalized = normalizeLanguage(value) ?? value
return (COLLAB_LANGUAGES as readonly string[]).includes(normalized as string) ? (normalized as CollabLanguage) : 'C'
return (COLLAB_LANGUAGES as readonly string[]).includes(value as string) ? (value as CollabLanguage) : 'C'
}
/**