Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 11 additions & 59 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,73 +1,25 @@
```
# Dependencies
node_modules/
.pnpm-store/

# Build artifacts
dist/
build/
target/

# Turbo build cache
.turbo/

# Python cache
__pycache__/
*.pyc
*.pyo
*.pyd
# Logs and temp files
*.log
*.tmp

# Environment files
# Environment
.env
.env.local
.env.*
*.env.*

# IDE files
# Editor/IDE
.vscode/
.idea/
*.swp
*.swo

# Logs
*.log

# Temp files
*.tmp

# Coverage
coverage/
htmlcov/
.coverage

# MyPy
.mypy_cache/

# Pytest
.pytest_cache/

# Gradle
.gradle/

# Compressed files
*.zip
*.gz
*.tar
*.tgz
*.bz2
*.xz
*.7z
*.rar
*.zst
*.lz4
*.lzh
*.cab
*.arj
*.rpm
*.deb
*.Z
*.lz
*.lzo
*.tar.gz
*.tar.bz2
*.tar.xz
*.tar.zst
# Build outputs
dist/
build/
target/
```
7 changes: 5 additions & 2 deletions apps/@aether/converge-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// PORT - 监听端口(默认 1234)
// DATABASE_URL - Postgres 连接 URL(必需)
// REDIS_URL - Redis 连接 URL(可选,多实例广播)
import type { Extension } from '@hocuspocus/server'
import { Hocuspocus } from '@hocuspocus/server'
import { getDb } from './db.js'
import { AetherDatabaseExtension } from './extensions/database.js'
Expand All @@ -18,15 +19,17 @@ const PORT = parseInt(process.env.PORT ?? '1234', 10)
const REDIS_URL = process.env.REDIS_URL
async function main() {
const db = getDb()
const extensions = []
const extensions: Extension[] = []
// Database extension: 接入 @aether/db crdt_updates 表
extensions.push(new AetherDatabaseExtension({ db }))
// Redis extension: 多实例广播 seam(可选)
// P2-15 修复:配置了 REDIS_URL 但依赖缺失时 createRedisExtension 会 throw,
// 由 main().catch() 捕获并退出,避免静默降级为单实例模式。
if (REDIS_URL) {
const redisExt = await createRedisExtension({ redisUrl: REDIS_URL })
extensions.push(redisExt)
if (redisExt) {
extensions.push(redisExt)
}
// eslint-disable-next-line no-console
console.log('[converge-server] Redis extension enabled for multi-instance broadcast.')
}
Expand Down
Loading
Loading