Compare commits

..

5 Commits

Author SHA1 Message Date
bf29551a31 ci: retrigger after Batch 2 timeout flake
All checks were successful
PR Preview / test (pull_request) Has been skipped
Deploy Production / test (push) Successful in 6s
PR Preview / teardown-preview (pull_request) Successful in 13s
PR Preview / deploy-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 6s
Test / build-check (push) Successful in 4s
Deploy Production / deploy (push) Successful in 5s
Test / e2e-test (push) Successful in 2m59s
2026-04-15 10:05:21 +00:00
a8c9c2252f fix: hourly-backup 改用 python sqlite3 API 做一致性备份
Some checks failed
Test / unit-test (push) Successful in 5s
PR Preview / teardown-preview (pull_request) Has been skipped
Test / build-check (push) Successful in 4s
Test / e2e-test (push) Failing after 6m1s
PR Preview / test (pull_request) Successful in 6s
PR Preview / deploy-preview (pull_request) Successful in 8s
镜像里没有 sqlite3 CLI,原来的 .backup 命令 15 天前就静默失败了。
daily-minio-backup 用 cp 就够,但 hourly 每小时跑要求更强一致性,
改用 Python 内置 sqlite3 的 .backup() API。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 09:56:40 +00:00
6baecfc2bf ci: retrigger after Batch 3 timeout flake
All checks were successful
PR Preview / test (pull_request) Has been skipped
Deploy Production / test (push) Successful in 7s
PR Preview / teardown-preview (pull_request) Successful in 13s
PR Preview / deploy-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 6s
Test / build-check (push) Successful in 4s
Deploy Production / deploy (push) Successful in 6s
Test / e2e-test (push) Successful in 2m59s
2026-04-15 09:10:44 +00:00
fam
a0de8fa7f3 Merge branch 'main' into feat/kit-export-volume
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 7s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 5s
PR Preview / deploy-preview (pull_request) Successful in 16s
Test / e2e-test (push) Failing after 6m56s
2026-04-15 08:54:54 +00:00
0ce14352f1 feat: 套装方案对比导出时配方名后附容量
All checks were successful
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 5s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 6s
PR Preview / deploy-preview (pull_request) Successful in 14s
Test / e2e-test (push) Successful in 2m58s
形如「某配方(100ml)」。full/simple/横向对比三个 sheet 都带上。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 23:03:05 +00:00
2 changed files with 11 additions and 6 deletions

View File

@@ -18,12 +18,14 @@ spec:
- sh
- -c
- |
set -e
BACKUP_DIR=/data/backups
mkdir -p $BACKUP_DIR
DATE=$(date +%Y%m%d_%H%M%S)
# Backup SQLite database using .backup for consistency
sqlite3 /data/oil_calculator.db ".backup '$BACKUP_DIR/oil_calculator_${DATE}.db'"
echo "Backup done: $BACKUP_DIR/oil_calculator_${DATE}.db ($(du -h $BACKUP_DIR/oil_calculator_${DATE}.db | cut -f1))"
DST="$BACKUP_DIR/oil_calculator_${DATE}.db"
# Consistent snapshot via Python's sqlite3 .backup API (sqlite3 CLI not in image)
python3 -c "import sqlite3; s=sqlite3.connect('/data/oil_calculator.db'); d=sqlite3.connect('$DST'); s.backup(d); d.close(); s.close()"
echo "Backup done: $DST ($(du -h $DST | cut -f1))"
# Keep last 48 backups (2 days of hourly)
ls -t $BACKUP_DIR/oil_calculator_*.db | tail -n +49 | xargs rm -f 2>/dev/null
echo "Backups retained: $(ls $BACKUP_DIR/oil_calculator_*.db | wc -l)"

View File

@@ -267,8 +267,9 @@ async function exportExcel(mode) {
const unit = oils.unitLabel(i.oil)
return `${i.oil} ${i.drops}${unit}`
}).join('、')
const vol = volumeLabel(r)
ws.addRow([
r.name,
vol ? `${r.name}${vol}` : r.name,
(r.tags || []).join('/'),
ingredientStr,
calcMaxTimes(r),
@@ -287,8 +288,9 @@ async function exportExcel(mode) {
for (const r of ka.recipes) {
const price = getSellingPrice(r._id)
const margin = calcMargin(r.kitCost, price)
const vol = volumeLabel(r)
ws.addRow([
r.name,
vol ? `${r.name}${vol}` : r.name,
calcMaxTimes(r),
Number(r.kitCost.toFixed(2)),
Number(r.originalCost.toFixed(2)),
@@ -326,7 +328,8 @@ async function exportExcel(mode) {
for (const row of crossComparison.value) {
const price = getSellingPrice(row.id)
const vals = [row.name]
const vol = volumeLabel(row)
const vals = [vol ? `${row.name}${vol}` : row.name]
if (mode === 'full') vals.push((row.tags || []).join('/'))
for (const ka of kitAnalysis.value) {
const cost = row.costs[ka.id]