Skip to content

Commit a730c9f

Browse files
Update main ingestion function to reduce retry attempts and improve error handling; ensure data directory is created correctly in Codebase class.
1 parent 8df03f1 commit a730c9f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

ingestion/src/main.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ async function main() {
2727
await new Promise((resolve) => setTimeout(resolve, 1000))
2828
console.clear()
2929

30-
let tries = 5
30+
let tries = 1
3131
while (tries--) {
3232
try {
3333
const sessionID = "Rocket.Chat" // uuid()
3434

35-
await Algorithms.execCommand(`git clone ${REPO_URI} ${sessionID}`)
35+
// await Algorithms.execCommand(`git clone ${REPO_URI} ${sessionID}`)
3636
{
3737
const codebase = new Codebase(sessionID, new FileProcessor(), 1)
3838
await codebase.process()
@@ -42,10 +42,11 @@ async function main() {
4242

4343
await insertDataIntoDB(codebase.dataDirPath)
4444
}
45-
await Algorithms.execCommand(`rm -rf ${sessionID}`)
45+
// await Algorithms.execCommand(`rm -rf ${sessionID}`)
4646

4747
break
48-
} catch {
48+
} catch (e) {
49+
throw e
4950
console.error("Retrying", tries)
5051
}
5152
}

ingestion/src/process/prepare/codebase.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class Codebase {
4646

4747
/* Handle data directory */
4848
if (removeExisting && existsSync(this._dataDirPath)) rmSync(this._dataDirPath, { recursive: true })
49-
// mkdirSync(this._dataDirPath)
49+
mkdirSync(this._dataDirPath)
5050
}
5151

5252
private prepareFilesMetadata() {

0 commit comments

Comments
 (0)