1
- import { Context } from "@azure/functions" ;
2
1
import BloomParseServer from "../common/BloomParseServer" ;
3
2
import { deleteFilesByPrefix } from "../common/s3" ;
4
3
import { Environment } from "../common/utils" ;
5
4
6
- export async function bookCleanupInternal ( env : Environment , context : Context ) {
5
+ export async function bookCleanupInternal ( env : Environment , log : Function ) {
7
6
const parseServer = new BloomParseServer ( env ) ;
8
7
9
8
const runInSafeMode = env === Environment . PRODUCTION ;
@@ -19,7 +18,7 @@ export async function bookCleanupInternal(env: Environment, context: Context) {
19
18
// Delete files from S3 for partial upload.
20
19
await deleteFilesByPrefix ( bookPrefixToDelete , env ) ;
21
20
}
22
- context . log (
21
+ log (
23
22
`${
24
23
runInSafeMode ? "Safe Mode. Would have deleted" : "Deleted"
25
24
} files with prefix ${ bookPrefixToDelete } from S3.`
@@ -30,7 +29,7 @@ export async function bookCleanupInternal(env: Environment, context: Context) {
30
29
// Delete new book record which was never fully created.
31
30
await parseServer . deleteBookRecord ( book . objectId , sessionToken ) ;
32
31
}
33
- context . log (
32
+ log (
34
33
`${
35
34
runInSafeMode ? "Safe Mode. Would have deleted" : "Deleted"
36
35
} book record with ID ${ book . objectId } .`
@@ -46,7 +45,7 @@ export async function bookCleanupInternal(env: Environment, context: Context) {
46
45
sessionToken
47
46
) ;
48
47
}
49
- context . log (
48
+ log (
50
49
`${
51
50
runInSafeMode ? "Safe Mode. Would have updated" : "Updated"
52
51
} book record with ID ${
0 commit comments