console log cleanup

This commit is contained in:
2023-02-03 17:00:03 +00:00
parent cdc687959b
commit b8de41e592
6 changed files with 93 additions and 33 deletions
+26 -18
View File
@@ -431,11 +431,11 @@ export const downloadAllProgressFiles = async (
containerName,
progressBlobObj
) => {
console.log(
"/////////////////////////\n downloading files: " +
JSON.stringify(progressBlobObj) +
"\n/////////////////////////\n"
);
// console.log(
// "/////////////////////////\n downloading files: " +
// JSON.stringify(progressBlobObj) +
// "\n/////////////////////////\n"
// );
const containerToken = await createContainerSas(containerName);
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
@@ -449,7 +449,7 @@ export const downloadAllProgressFiles = async (
let blobCount = 0;
for (const prop in progressBlobObj) {
console.log(`Progress - ${prop}: ${progressBlobObj[prop].path}`);
//console.log(`Progress - ${prop}: ${progressBlobObj[prop].path}`);
blobClient = containerClient.getBlobClient(progressBlobObj[prop].path);
downloadedBlob = await blobClient.download(0);
downloaded =
@@ -462,7 +462,7 @@ export const downloadAllProgressFiles = async (
downloaded = downloaded.substring(0, downloaded.length - 1);
for (const prop in progressBlobObj) {
console.log(`Cases - ${prop}: ${progressBlobObj[prop].caseObj}`);
//console.log(`Cases - ${prop}: ${progressBlobObj[prop].caseObj}`);
blobClient = containerClient.getBlobClient(
progressBlobObj[prop].caseObj
);
@@ -487,11 +487,11 @@ export const downloadAllProgressFiles = async (
};
export const downloadAllRepsFiles = async (containerName, repsBlobObj) => {
console.log(
"/////////////////////////\n downloading files: " +
JSON.stringify(repsBlobObj) +
"\n/////////////////////////\n"
);
// console.log(
// "/////////////////////////\n downloading files: " +
// JSON.stringify(repsBlobObj) +
// "\n/////////////////////////\n"
// );
const containerToken = await createContainerSas(containerName);
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
@@ -506,7 +506,7 @@ export const downloadAllRepsFiles = async (containerName, repsBlobObj) => {
let blobCount = 0;
for (const prop in repsBlobObj) {
console.log(`Progress - ${prop}: ${repsBlobObj[prop].name}`);
//console.log(`Progress - ${prop}: ${repsBlobObj[prop].name}`);
blobClient = containerClient.getBlobClient(repsBlobObj[prop].name);
downloadedBlob = await blobClient.download(0);
let repBlobObj = await streamToBuffer(
@@ -578,13 +578,17 @@ export const getProgressBlobs = async (containerName, caseReference) => {
blobCount++;
}
console.log("this is the caasefolder:", caseReference, blobCount);
console.log(
"this is the casefolder and blobcount:",
caseReference,
blobCount
);
let blobObj = [];
for await (const blob of containerClient.listBlobsFlat({
prefix: caseReference + "/" + caseReference + "_appeal.json",
})) {
console.log("in here");
console.log("getProgressBlobs in here");
blobObj.push({
"name": blob.name.split("/")[1],
"path": blob.name,
@@ -676,14 +680,18 @@ export const getRepslobs = async (containerName, caseReference) => {
blobCount++;
}
console.log("this is the caasefolder:", caseReference, blobCount);
console.log(
"this is the casefolder and blobcount:",
caseReference,
blobCount
);
let blobObj = [];
for await (const blob of containerClient.findBlobsByTags(
"blobType='Representation'"
)) {
console.log("in here");
console.log(blob);
// console.log("getRepslobs in here");
// console.log(blob);
blobObj.push(blob);
}