Refactor test database setup and add migrations
- Updated test files to use a separate test database configuration. - Introduced a new helper module for managing test database operations. - Added a setup file to configure the environment for tests. - Created new database migration scripts to optimize message indexing. - Added a sample environment file for test database configuration.
This commit is contained in:
@@ -38,7 +38,7 @@ export async function uploadRecordingSegment(input: {
|
||||
|
||||
try {
|
||||
// 1. Get file size and insert initial pending state to DB
|
||||
const stats = fs.statSync(oggPath);
|
||||
const stats = await fs.promises.stat(oggPath);
|
||||
await insertVoiceRecording({
|
||||
id,
|
||||
user_id: userId,
|
||||
@@ -54,7 +54,7 @@ export async function uploadRecordingSegment(input: {
|
||||
});
|
||||
|
||||
// 2. Perform async upload with retry logic
|
||||
const fileBuffer = fs.readFileSync(oggPath);
|
||||
const fileBuffer = await fs.promises.readFile(oggPath);
|
||||
const uploadResult = await uploadToTele({
|
||||
buffer: fileBuffer,
|
||||
filename: fileName,
|
||||
|
||||
Reference in New Issue
Block a user