Skip to content

Commit f2833a7

Browse files
authored
more logs and fix indexer (#17)
Signed-off-by: Grant Linville <[email protected]>
1 parent 4bc0fbb commit f2833a7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

indexer/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func reindexRemoteTools(db *sql.DB, apiURL *url.URL) {
9494
index string
9595
reference string
9696
content string
97-
description string
97+
description *string
9898
lastIndexedAt string
9999
createdAt string
100100
systemTool bool

src/server/api/[...slug].post.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ export default defineEventHandler(async (event) => {
5151
const [owner, repo, ...subdirs] = url.replace(/^(https?:\/\/)?(www\.)?github\.com\//, '').split('/')
5252

5353
// find the default branch name
54+
console.log(`Checking GitHub API for repo ${owner}/${repo}`)
5455
const branchResponse = await octokit.request(`GET https://api.github.com/repos/${ owner }/${ repo }`)
56+
console.log(`Got response code ${branchResponse.status} from GitHub API`)
5557
const branch = branchResponse.data.default_branch
5658

5759
// construct the path to the tool.gpt file
@@ -62,6 +64,7 @@ export default defineEventHandler(async (event) => {
6264

6365
if (!toolResponse.ok) {
6466
// clean-up any existing tools if the tool.gpt file is no longer found or is private
67+
console.log(`Got response code ${toolResponse.status} from raw.githubusercontent.com/${owner}/${repo}/${branch}/${path}/tool.gpt`)
6568
if (toolResponse.status === 404 || toolResponse.status === 403) {
6669
await db.removeToolForUrlIfExists(url)
6770
}

0 commit comments

Comments
 (0)