Skip to content

Commit ec6111c

Browse files
committed
Minor changes
1 parent 9902da5 commit ec6111c

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

rocket-chatter-ingestion-server/src/process/prepare/codebase.ts

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -81,29 +81,6 @@ export class Codebase {
8181
return entries.length
8282
}
8383

84-
/**
85-
* The main function to process the files in the codebase. The function works in the following
86-
* steps:
87-
*
88-
* 1. Process the files in parallel of size `batchSize` and gather all the nodes in the `nodes` object.
89-
* 2. After gathering all the nodes from the files, it's not guranteed that they can't be more than
90-
* `batchSize` nodes. So, we need to split the nodes into batches of `batchSize` nodes separately.
91-
* 3. Repeat Step 1 and Step 2 for all the files.
92-
*
93-
* @returns Promise<void>
94-
*/
95-
async process(): Promise<void> {
96-
// console.log("🕒 Preparing Nodes\n")
97-
98-
let nodesProcessed = 0
99-
for (const [index, batch] of this._batches.entries()) {
100-
const [start, end] = batch
101-
nodesProcessed += await this.processFilesBatch(index, start, end)
102-
}
103-
104-
// console.log(`✅ Prepared ${nodesProcessed} nodes`)
105-
}
106-
10784
private async processFilesBatch(
10885
batchNumber: number,
10986
start: number,
@@ -143,4 +120,27 @@ export class Codebase {
143120

144121
return nNodesProcessed
145122
}
123+
124+
/**
125+
* The main function to process the files in the codebase. The function works in the following
126+
* steps:
127+
*
128+
* 1. Process the files in parallel of size `batchSize` and gather all the nodes in the `nodes` object.
129+
* 2. After gathering all the nodes from the files, it's not guranteed that they can't be more than
130+
* `batchSize` nodes. So, we need to split the nodes into batches of `batchSize` nodes separately.
131+
* 3. Repeat Step 1 and Step 2 for all the files.
132+
*
133+
* @returns Promise<void>
134+
*/
135+
async process(): Promise<void> {
136+
// console.log("🕒 Preparing Nodes\n")
137+
138+
let nodesProcessed = 0
139+
for (const [index, batch] of this._batches.entries()) {
140+
const [start, end] = batch
141+
nodesProcessed += await this.processFilesBatch(index, start, end)
142+
}
143+
144+
// console.log(`✅ Prepared ${nodesProcessed} nodes`)
145+
}
146146
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,12 @@ export async function ingestRoute(req: Request, res: Response) {
162162
message: "INGESTION INITIATED",
163163
})
164164

165-
const sessionID = uuidv4()
166-
167165
const startTime = Date.now()
168166
{
169167
let success = false
170168

169+
const sessionID = uuidv4()
170+
171171
/* Step 1: Fetch codebase to local storage */
172172
success = await fetchCodebaseFromRemote(
173173
sessionID,

0 commit comments

Comments
 (0)