tangled
alpha
login
or
join now
nekomimi.pet
/
wisp.place-monorepo
88
fork
atom
Monorepo for wisp.place. A static site hosting service built on top of the AT Protocol.
wisp.place
88
fork
atom
overview
issues
9
pulls
pipelines
add cache-only mode to skip DB writes
nekomimi.pet
1 month ago
921a4760
285def4a
1/2
deploy-wisp.yml
success
35s
test.yml
failed
27s
+11
-1
2 changed files
expand all
collapse all
unified
split
apps
hosting-service
src
index.ts
lib
db.ts
+3
-1
apps/hosting-service/src/index.ts
···
2
2
import { serve } from '@hono/node-server';
3
3
import { initializeGrafanaExporters, createLogger } from '@wispplace/observability';
4
4
import { mkdirSync, existsSync } from 'fs';
5
5
-
import { startDomainCacheCleanup, stopDomainCacheCleanup, closeDatabase } from './lib/db';
5
5
+
import { startDomainCacheCleanup, stopDomainCacheCleanup, closeDatabase, CACHE_ONLY } from './lib/db';
6
6
import { closeRevalidateQueue } from './lib/revalidate-queue';
7
7
import { startCacheInvalidationSubscriber, stopCacheInvalidationSubscriber } from './lib/cache-invalidation';
8
8
import { storage, getStorageConfig } from './lib/storage';
···
69
69
70
70
Server: http://localhost:${PORT}
71
71
Health: http://localhost:${PORT}/health
72
72
+
73
73
+
Mode: ${CACHE_ONLY ? 'CACHE-ONLY (no DB writes)' : 'Standard (with DB writes)'}
72
74
73
75
Tiered Storage Configuration:
74
76
Hot Cache: ${storageConfig.hotCacheSize} (${storageConfig.hotCacheCount} items max)
+8
apps/hosting-service/src/lib/db.ts
···
10
10
}
11
11
);
12
12
13
13
+
// Cache-only mode: skip all DB writes and only use tiered storage
14
14
+
export const CACHE_ONLY = process.env.CACHE_ONLY === 'true';
15
15
+
13
16
// Domain lookup cache with TTL
14
17
const DOMAIN_CACHE_TTL = 5 * 60 * 1000; // 5 minutes
15
18
···
128
131
recordCid: string,
129
132
fileCids: Record<string, string>
130
133
): Promise<void> {
134
134
+
if (CACHE_ONLY) {
135
135
+
console.log('[DB] Cache-only mode: skipping upsertSiteCache', { did, rkey });
136
136
+
return;
137
137
+
}
138
138
+
131
139
try {
132
140
await sql`
133
141
INSERT INTO site_cache (did, rkey, record_cid, file_cids, cached_at, updated_at)