Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gildforge/kit",
"version": "0.7.8",
"version": "0.7.9",
"description": "The shared engine, views and server behind gild: the git forge for agents on Cloudflare.",
"license": "Apache-2.0",
"type": "module",
Expand Down
17 changes: 12 additions & 5 deletions src/server/api/imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,20 @@ export async function apiImports(c:Context):Promise<Result> {
return {data:{ok:true}}
}
if(id==='importFinish') {
if(!b.error && b.default_branch) {const state=await st.settings.state(`${owner}/${repo}`);await st.settings.putState({...state,defaultBranch:b.default_branch})}
const finished=await job.finish(token,b.warnings,b.error,b.summary)
// The repository is all there: finishing its import refs and summary and
// re-indexing take tens of seconds, longer than an importer waits for an
// answer, so they run after it (a failure is logged; the data stays).
if(!b.error) {
if(b.default_branch) {const state=await st.settings.state(`${owner}/${repo}`);await st.settings.putState({...state,defaultBranch:b.default_branch})}
const { finishImportRefs } = await import('../import/finish.js')
await finishImportRefs(owner,repo,active.internalPrefix??'import/pr',{url:active.source,mirror:active.mirror,readOnly:false,warnings:b.warnings,summary:b.summary})
await scheduleIndex(owner,repo)
const work=(async()=>{
const { finishImportRefs } = await import('../import/finish.js')
await finishImportRefs(owner,repo,active.internalPrefix??'import/pr',{url:active.source,mirror:active.mirror,readOnly:false,warnings:b.warnings,summary:b.summary})
await scheduleIndex(owner,repo)
})().catch(e=>console.error('Import finishing failed',owner,repo,e instanceof Error?e.message:e))
;(await getCloudflareContext()).ctx.waitUntil(work)
}
return {data:await job.finish(token,b.warnings,b.error,b.summary)}
return {data:finished}
}
void active
throw new ApiError(404,'Not Found')
Expand Down
Loading