Skip to content

Commit

Permalink
UBERF-9075 Disable meeting recordings when not using s3 or datalake (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
aonnikov authored Jan 9, 2025
1 parent 79f2ad8 commit 8c3dd61
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
11 changes: 8 additions & 3 deletions services/love/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const main = async (): Promise<void> => {

// eslint-disable-next-line @typescript-eslint/no-misused-promises
app.get('/checkRecordAvailable', async (_req, res) => {
res.send(await checkRecordAvailable(storageConfig))
res.send(await checkRecordAvailable(storageConfig, s3storageConfig))
})

// eslint-disable-next-line @typescript-eslint/no-misused-promises
Expand Down Expand Up @@ -254,8 +254,13 @@ const createToken = async (roomName: string, _id: string, participantName: strin
return await at.toJwt()
}

const checkRecordAvailable = async (storageConfig: StorageConfig | undefined): Promise<boolean> => {
return storageConfig !== undefined
const checkRecordAvailable = async (
storageConfig: StorageConfig | undefined,
s3storageConfig: StorageConfig | undefined
): Promise<boolean> => {
if (storageConfig !== undefined && storageConfig.kind === 's3') return true
if (storageConfig !== undefined && storageConfig.kind === 'datalake' && s3storageConfig !== undefined) return true
return false
}

const startRecord = async (
Expand Down
6 changes: 0 additions & 6 deletions services/love/src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ export async function getS3UploadParams (
s3StorageConfig: StorageConfig | undefined
): Promise<S3UploadParams> {
if (storageConfig.kind === 's3') {
if (storageConfig.kind !== 's3') {
throw new Error('Please provide S3 storage config')
}
return await getS3UploadParamsS3(ctx, workspaceId, storageConfig as S3Config)
} else if (storageConfig.kind === 'datalake') {
if (s3StorageConfig === undefined || s3StorageConfig.kind !== 's3') {
Expand All @@ -62,9 +59,6 @@ export async function saveFile (
filename: string
): Promise<Blob | undefined> {
if (storageConfig.kind === 's3') {
if (storageConfig.kind !== 's3') {
throw new Error('Please provide S3 storage config')
}
return await saveFileToS3(ctx, workspaceId, storageConfig as S3Config, filename)
} else if (storageConfig.kind === 'datalake') {
if (s3StorageConfig === undefined || s3StorageConfig.kind !== 's3') {
Expand Down

0 comments on commit 8c3dd61

Please sign in to comment.