- 在 .env.example 中添加 Kafka 配置项:KAFKA_FETCH_MAX_BYTES, KAFKA_FETCH_MIN_BYTES, KAFKA_FETCH_MAX_WAIT_MS。 - 删除 room_status_sync 提案及相关文档。 - 删除 fix_uint64_overflow 提案及相关文档。 - 更新数据库管理器以支持使用 COPY 语句进行高效数据写入,替换批量 INSERT 逻辑。 - 实现心跳数据的整数溢出处理,确保无效数据被持久化到 heartbeat_events_errors 表。 - 更新处理器规范,确保心跳数据成功写入历史表后触发 room_status 同步。 - 添加新文档,描述新的分区方法案例。 - 归档旧的提案和规范文档以保持项目整洁。
28 lines
774 B
JavaScript
28 lines
774 B
JavaScript
import { defineConfig } from 'vite';
|
|
import { resolve } from 'path';
|
|
|
|
export default defineConfig({
|
|
build: {
|
|
lib: {
|
|
entry: resolve(__dirname, 'src/index.js'),
|
|
name: 'WebBLSHeartbeatServer',
|
|
formats: ['es'],
|
|
fileName: (format) => `index.${format}.js`
|
|
},
|
|
rollupOptions: {
|
|
external: [
|
|
'kafka-node', 'pg', 'redis', 'pg-copy-streams',
|
|
// Node.js core modules
|
|
'events', 'url', 'crypto', 'util', 'net', 'tls', 'buffer', 'path', 'stream', 'stream/promises',
|
|
'node:zlib', 'node:fs', 'node:path', 'node:url', 'node:stream', 'node:stream/promises'
|
|
],
|
|
output: {
|
|
globals: {
|
|
'kafka-node': 'KafkaNode',
|
|
'pg': 'Pg',
|
|
'redis': 'Redis'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}); |