dsh-soul-forging 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/brain +1 -1
- package/bin/serve +1 -1
- package/bin/sync +2 -2
- package/package.json +1 -1
package/bin/brain
CHANGED
|
@@ -15,6 +15,6 @@ fi
|
|
|
15
15
|
QENC=$("$PY" -c 'import sys,urllib.parse;print(urllib.parse.quote(sys.argv[1]))' "$Q")
|
|
16
16
|
OUT=$(curl -s -m 5 "$BRAIN_URL/text?q=$QENC&n=$N" 2>/dev/null)
|
|
17
17
|
if [ -z "$OUT" ] || echo "$OUT" | grep -q "Connection refused"; then
|
|
18
|
-
OUT=$("$PY" "$
|
|
18
|
+
OUT=$("$PY" "$MEMKIT_ROOT/brain/server.py" --query "$Q" -n "$N" 2>/dev/null)
|
|
19
19
|
fi
|
|
20
20
|
printf '%s\n' "$OUT"
|
package/bin/serve
CHANGED
|
@@ -6,7 +6,7 @@ if curl -s -m 2 "$BRAIN_URL/health" | grep -q '"ok": true'; then
|
|
|
6
6
|
echo "已在跑:$BRAIN_URL"; exit 0
|
|
7
7
|
fi
|
|
8
8
|
mkdir -p "$BRAIN_DIR"
|
|
9
|
-
nohup "$PY" "$
|
|
9
|
+
nohup "$PY" "$MEMKIT_ROOT/brain/server.py" >"$BRAIN_DIR/server.log" 2>&1 &
|
|
10
10
|
sleep 1
|
|
11
11
|
curl -s -m 2 "$BRAIN_URL/health" || { echo "起不来,看 $BRAIN_DIR/server.log"; exit 1; }
|
|
12
12
|
echo
|
package/bin/sync
CHANGED
|
@@ -9,9 +9,9 @@ exec 9>"$LOCK"
|
|
|
9
9
|
if ! flock -n 9; then echo "同步已在运行,跳过"; exit 0; fi
|
|
10
10
|
|
|
11
11
|
R="$BIN_DIR/runlog"; rc=0
|
|
12
|
-
$R "live-summary" -- "$PY" "$
|
|
12
|
+
$R "live-summary" -- "$PY" "$MEMKIT_ROOT/brain/fix-live-summary.py" || rc=$((rc+1))
|
|
13
13
|
$R "archive-log" -- "$BIN_DIR/archive-log" || rc=$((rc+2))
|
|
14
|
-
$R "index" -- "$PY" "$
|
|
14
|
+
$R "index" -- "$PY" "$MEMKIT_ROOT/brain/index.py" || rc=$((rc+4))
|
|
15
15
|
$R "reload" -- bash -c "curl -s -m 5 -X POST $BRAIN_URL/reload >/dev/null" || rc=$((rc+8))
|
|
16
16
|
$R "check" -- "$BIN_DIR/soul" check || rc=$((rc+16))
|
|
17
17
|
[ -n "${SOUL_BACKUP_CMD:-}" ] && { $R "backup" -- bash -c "$SOUL_BACKUP_CMD" || rc=$((rc+32)); }
|