add some logs

This commit is contained in:
Anupam
2022-12-28 18:32:12 +00:00
parent e521d9e753
commit 7f4037254e
4 changed files with 21 additions and 2 deletions
+4
View File
@@ -69,6 +69,8 @@ export function finalIds(input: Input): Observable<string[]> {
).pipe(
// This code block executes on batches of 100 versions starting from oldest
map(value => {
console.log('If block')
console.log(`value: ${JSON.stringify(value)}`)
/*
Here first filter out the versions that are to be ignored.
Then update input.numOldeVersionsToDelete to the no of versions deleted from the next 100 versions batch.
@@ -94,6 +96,8 @@ export function finalIds(input: Input): Observable<string[]> {
).pipe(
// This code block executes on batches of 100 versions starting from oldest
map(value => {
console.log('Else block')
console.log(`value: ${JSON.stringify(value)}`)
/*
Here totalCount is the total no of versions in the package.
First we update totalCount by removing no of ignored versions from it and also filter them out from value.
+3
View File
@@ -88,6 +88,9 @@ export function deletePackageVersions(
packageType: string,
token: string
): Observable<boolean> {
console.log(`Total versions to delete: ${packageVersionIds.length}`)
console.log(`Versions to delete: ${packageVersionIds}`)
if (packageVersionIds.length === 0) {
return of(true)
}
+5 -1
View File
@@ -50,7 +50,7 @@ export function getOldestVersions(
)
}),
map(response => {
return {
const resp = {
versions: response.data.map((version: GetVersionsResponse[0]) => {
return {
id: version.id,
@@ -61,6 +61,10 @@ export function getOldestVersions(
paginate: response.data.length === numVersions,
totalCount: response.data.length
}
console.log(
`Response from getOldestVersions method: ${JSON.stringify(resp)}`
)
return resp
})
)
}