Skip to content

Commit 2064d1e

Browse files
committed
Used uuid instead of nanoid for generating unique ids
1 parent 432b242 commit 2064d1e

File tree

5 files changed

+30
-9
lines changed

5 files changed

+30
-9
lines changed
1.03 KB
Binary file not shown.

rocket-chatter-ingestion-server/package-lock.json

Lines changed: 22 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rocket-chatter-ingestion-server/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"main": "src/main.ts",
23
"scripts": {
34
"dev": "npm run serve",
45
"serve": "nodemon src/main.ts",
@@ -19,6 +20,7 @@
1920
"@types/cli-progress": "^3.11.5",
2021
"@types/cors": "^2.8.17",
2122
"@types/express": "^4.17.21",
23+
"@types/uuid": "^10.0.0",
2224
"@typescript-eslint/parser": "^7.14.1",
2325
"ast-types": "^0.14.2",
2426
"cli-progress": "^3.12.0",
@@ -31,6 +33,7 @@
3133
"neo4j-driver": "4.4.0",
3234
"ollama": "^0.5.0",
3335
"openai": "^4.29.2",
34-
"recast": "^0.23.9"
36+
"recast": "^0.23.9",
37+
"uuid": "^10.0.0"
3538
}
36-
}
39+
}

rocket-chatter-ingestion-server/src/core/styleguides.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,14 @@ export async function insertStyleguides() {
5757
const node = new DBNode({
5858
id: filePath,
5959
name: filePath,
60-
kind: "File",
6160
type: "",
6261
code: data,
63-
comments: [],
6462
filePath: filePath,
6563
relations: [],
6664
nameEmbeddings: [],
6765
codeEmbeddings: [],
6866
descriptor: "Styleguide",
67+
isFile: true,
6968
})
7069
const job = transaction.run(node.getDBInsertQuery(), node)
7170
jobs.push(job)

rocket-chatter-ingestion-server/src/routes/ingest.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { exec } from "child_process"
22
import { Request, Response } from "express"
33
import { existsSync, rmdirSync } from "fs"
4-
import nanoid from "nanoid"
4+
import { v4 as uuidv4 } from "uuid"
55
import { insertStyleguides } from "../core/styleguides"
66
import { insertDataIntoDB } from "../process/ingest/ingest"
77
import { Codebase } from "../process/prepare/codebase"
@@ -166,9 +166,7 @@ export async function ingestRoute(req: Request, res: Response) {
166166
message: "INGESTION INITIATED",
167167
})
168168

169-
const sessionID = nanoid.customAlphabet(
170-
"1234567890abcdefghijklmnopqrstuvwxyz"
171-
)(10)
169+
const sessionID = uuidv4()
172170

173171
const startTime = Date.now()
174172
{

0 commit comments

Comments
 (0)