From f2833a707ddd89229652314812a4feb4f93845b7 Mon Sep 17 00:00:00 2001 From: Grant Linville Date: Tue, 20 Aug 2024 12:14:29 -0400 Subject: [PATCH] more logs and fix indexer (#17) Signed-off-by: Grant Linville --- indexer/main.go | 2 +- src/server/api/[...slug].post.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/indexer/main.go b/indexer/main.go index b667a62..4fae23e 100644 --- a/indexer/main.go +++ b/indexer/main.go @@ -94,7 +94,7 @@ func reindexRemoteTools(db *sql.DB, apiURL *url.URL) { index string reference string content string - description string + description *string lastIndexedAt string createdAt string systemTool bool diff --git a/src/server/api/[...slug].post.ts b/src/server/api/[...slug].post.ts index f6f5d28..bf0e80a 100644 --- a/src/server/api/[...slug].post.ts +++ b/src/server/api/[...slug].post.ts @@ -51,7 +51,9 @@ export default defineEventHandler(async (event) => { const [owner, repo, ...subdirs] = url.replace(/^(https?:\/\/)?(www\.)?github\.com\//, '').split('/') // find the default branch name + console.log(`Checking GitHub API for repo ${owner}/${repo}`) const branchResponse = await octokit.request(`GET https://api.github.com/repos/${ owner }/${ repo }`) + console.log(`Got response code ${branchResponse.status} from GitHub API`) const branch = branchResponse.data.default_branch // construct the path to the tool.gpt file @@ -62,6 +64,7 @@ export default defineEventHandler(async (event) => { if (!toolResponse.ok) { // clean-up any existing tools if the tool.gpt file is no longer found or is private + console.log(`Got response code ${toolResponse.status} from raw.githubusercontent.com/${owner}/${repo}/${branch}/${path}/tool.gpt`) if (toolResponse.status === 404 || toolResponse.status === 403) { await db.removeToolForUrlIfExists(url) }