Skip to content
Merged
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
5 changes: 5 additions & 0 deletions core/handlers_paper.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,3 +605,8 @@ func clampInt(v, lo, hi int) int {
}
return v
}

// ExtractPDFTextPublic 供 goserver 等外部调用方使用(PDF 文本层提取)。
func ExtractPDFTextPublic(pdfPath string, maxPages int) string {
return extractPDFText(pdfPath, maxPages)
}
4 changes: 2 additions & 2 deletions core/wiki.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type milestone struct {
}

// pageRank 引用图 PageRank(Python _pagerank 移植——20 轮迭代阻尼 0.85)。
func pageRank(nodes []string, edges [][2]string) map[string]float64 {
func PageRank(nodes []string, edges [][2]string) map[string]float64 {
if len(nodes) == 0 {
return nil
}
Expand Down Expand Up @@ -101,7 +101,7 @@ func (e *HandlerEnv) milestonesForTopic(topicID string, limit int) []milestone {
if len(nodes) == 0 {
return nil
}
rank := pageRank(nodes, edges)
rank := PageRank(nodes, edges)
// 取分数 top 30 的论文标题 + 年份
type pr struct {
id string
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ services:
container_name: papermind-goserver
volumes:
- pm_agent_dir:/data
- pm_data:/app/data
env_file:
- ./.env
environment:
Expand Down
4 changes: 4 additions & 0 deletions scripts/auto_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ log "等待健康检查 (40s)..."
sleep 40
if curl -sf --max-time 10 http://localhost:8002/health >/dev/null 2>&1; then
log "OK: backend 健康检查通过"
# frontend nginx 启动时解析 upstream IP 并缓存——goserver/core 容器重建后
# 旧 IP 失效(502 Connection refused 实证),每次部署后重启重新解析
docker compose restart frontend >/dev/null 2>&1 || true
log "frontend 已重启(刷新 upstream DNS)"
echo "$REMOTE_SHA" > "$SHA_FILE"
log "=== 部署成功! SHA=$REMOTE_SHA_SHORT 已记录 ==="
else
Expand Down
Loading
Loading