kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
fix: small ci fixes
rodzic
c32f94c05d
commit
7e05c66a74
|
@ -157,7 +157,9 @@ export async function upsertConsumer(
|
||||||
.where(eq(schema.consumers.id, consumer.id))
|
.where(eq(schema.consumers.id, consumer.id))
|
||||||
.returning()
|
.returning()
|
||||||
} else {
|
} else {
|
||||||
;[consumer] = await db.insert(schema.consumers).values({
|
;[consumer] = await db
|
||||||
|
.insert(schema.consumers)
|
||||||
|
.values({
|
||||||
plan,
|
plan,
|
||||||
userId,
|
userId,
|
||||||
projectId,
|
projectId,
|
||||||
|
@ -165,6 +167,7 @@ export async function upsertConsumer(
|
||||||
token: await createConsumerToken(),
|
token: await createConsumerToken(),
|
||||||
_stripeCustomerId: stripeCustomer.id
|
_stripeCustomerId: stripeCustomer.id
|
||||||
})
|
})
|
||||||
|
.returning()
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(consumer, 500, 'Error creating consumer')
|
assert(consumer, 500, 'Error creating consumer')
|
||||||
|
|
|
@ -35,9 +35,9 @@ export function initExitHooks({
|
||||||
asyncExitHook(
|
asyncExitHook(
|
||||||
async function shutdownDbExitHook() {
|
async function shutdownDbExitHook() {
|
||||||
try {
|
try {
|
||||||
await db.$client.end({
|
if ('end' in db.$client) {
|
||||||
timeout: timeoutMs
|
await db.$client.end({ timeout: timeoutMs })
|
||||||
})
|
}
|
||||||
} catch {
|
} catch {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,55 +36,12 @@
|
||||||
"observability": {
|
"observability": {
|
||||||
"enabled": true
|
"enabled": true
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Smart Placement
|
|
||||||
* Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
|
|
||||||
*/
|
|
||||||
"placement": { "mode": "smart" },
|
"placement": { "mode": "smart" },
|
||||||
|
|
||||||
"upload_source_maps": true,
|
"upload_source_maps": true,
|
||||||
|
|
||||||
"analytics_engine_datasets": [
|
"analytics_engine_datasets": [
|
||||||
{
|
{
|
||||||
"binding": "AE_USAGE_DATASET",
|
"binding": "AE_USAGE_DATASET",
|
||||||
"dataset": "agentic_api_gateway_usage"
|
"dataset": "agentic_api_gateway_usage"
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
|
|
||||||
/**
|
|
||||||
* Environment Variables
|
|
||||||
* https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
|
|
||||||
*/
|
|
||||||
"env": {
|
|
||||||
"dev": {
|
|
||||||
"vars": {
|
|
||||||
"ENVIRONMENT": "development",
|
|
||||||
"AGENTIC_API_BASE_URL": "http://localhost:3001"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"prod": {
|
|
||||||
"vars": {
|
|
||||||
"ENVIRONMENT": "production",
|
|
||||||
"AGENTIC_API_BASE_URL": "https://api.agentic.so"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Note: Use secrets to store sensitive data.
|
|
||||||
* https://developers.cloudflare.com/workers/configuration/secrets/
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Static Assets
|
|
||||||
* https://developers.cloudflare.com/workers/static-assets/binding/
|
|
||||||
*/
|
|
||||||
// "assets": { "directory": "./public/", "binding": "ASSETS" },
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Service Bindings (communicate between multiple Workers)
|
|
||||||
* https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
|
|
||||||
*/
|
|
||||||
// "services": [{ "binding": "MY_SERVICE", "service": "my-service" }]
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ export function registerDeployCommand({
|
||||||
// publish it.
|
// publish it.
|
||||||
const deployment = await oraPromise(
|
const deployment = await oraPromise(
|
||||||
client.createDeployment(config, {
|
client.createDeployment(config, {
|
||||||
publish: !!opts.publish
|
publish: opts.publish ? 'true' : 'false'
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
text: `Creating deployment for project "${config.name}"`,
|
text: `Creating deployment for project "${config.name}"`,
|
||||||
|
|
Ładowanie…
Reference in New Issue