Skip to content

Commit a9160a0

Browse files
authored
fix: update devkit sync target path (#1030) (#580)
1 parent 13c7212 commit a9160a0

76 files changed

Lines changed: 10996 additions & 10083 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

samples/ai/edge-ai-demo-studio/frontend/next.config.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,32 @@
33

44
import withBundleAnalyzer from '@next/bundle-analyzer'
55
import { withPayload } from '@payloadcms/next/withPayload'
6+
import { logger } from './src/lib/logger'
67
import type { NextConfig } from 'next'
8+
import Database from 'libsql'
9+
import path from 'node:path'
710
import { getServicesPortMap } from './src/services/config-registry'
811

12+
const proxyTimeoutSetting = () => {
13+
const dbPath = path.resolve(process.cwd(), 'db.sqlite')
14+
const db = new Database(dbPath)
15+
16+
try {
17+
const row = db
18+
.prepare('SELECT proxy_timeout FROM app_settings LIMIT 1')
19+
.get() as { proxy_timeout?: number } | undefined
20+
return row?.proxy_timeout ?? 30
21+
} catch (error) {
22+
logger.warn(
23+
'[next.config.ts] proxyTimeout read skipped: ',
24+
error instanceof Error ? error.message : String(error),
25+
)
26+
return 30
27+
} finally {
28+
db.close()
29+
}
30+
}
31+
932
const bundleAnalyzer = withBundleAnalyzer({
1033
enabled: process.env.ANALYZE === 'true',
1134
})
@@ -42,6 +65,9 @@ const nextConfig: NextConfig = {
4265
})),
4366
]
4467
},
68+
experimental: {
69+
proxyTimeout: 1000 * proxyTimeoutSetting(),
70+
},
4571
}
4672

4773
export default bundleAnalyzer(withPayload(nextConfig))

0 commit comments

Comments
 (0)