From d6b2da2ecf5fcb4c3a1fdb6c03016ea297779b3e Mon Sep 17 00:00:00 2001 From: kadami <86646883+kadamidev@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:11:56 +0000 Subject: [PATCH] small fixes --- desci-server/src/scripts/fixPublish.ts | 5 ++--- desci-server/src/scripts/invalidate-redis-cache.ts | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/desci-server/src/scripts/fixPublish.ts b/desci-server/src/scripts/fixPublish.ts index ec6705b8..d5c22a42 100644 --- a/desci-server/src/scripts/fixPublish.ts +++ b/desci-server/src/scripts/fixPublish.ts @@ -3,7 +3,6 @@ import { logger as parentLogger } from '../logger.js'; import { redisClient } from '../redisClient.js'; import { publishSequencer, PublishServices } from '../services/PublishServices.js'; import { getIndexedResearchObjects } from '../theGraph.js'; -import { cleanupManifestUrl } from '../utils/manifest.js'; import { hexToCid } from '../utils.js'; import { invalidateByUuid } from './invalidate-redis-cache.js'; @@ -71,7 +70,7 @@ async function fixByNodeUuids({ const nodeUuidsArr = nodeUuids.split(','); const total = nodeUuidsArr.length; logger.info(`[fixByNodeUuids] nodeUuids loaded for fixing: ${total}`); - // debugger; + debugger; for (let index = 0; index < nodeUuidsArr.length; index++) { let nodeUuid = nodeUuidsArr[index]; @@ -97,7 +96,7 @@ async function fixByNodeUuids({ const commitId = ascendingVersions[nodeVersIdx]?.commitId; // const manifestUrl = cleanupManifestUrl(manifestCid); - cLogger.info(`[fixByNodeUuids] Fixing version: ${nodeVersIdx}, with commitId: ${commitId}`); + cLogger.info(`[fixByNodeUuids] Fixing version: ${nodeVersIdx + 1}, with commitId: ${commitId}`); if (createIjPublishStatusEntry) { // Add IJ publishStatus entry for the commitId diff --git a/desci-server/src/scripts/invalidate-redis-cache.ts b/desci-server/src/scripts/invalidate-redis-cache.ts index 4ce6e114..47e883d2 100644 --- a/desci-server/src/scripts/invalidate-redis-cache.ts +++ b/desci-server/src/scripts/invalidate-redis-cache.ts @@ -68,8 +68,10 @@ export async function invalidateByUuid({ nodeUuid }: { nodeUuid: string }) { const totalVersionsIndexed = indexedNode.versions.length || 0; try { for (let nodeVersIdx = 0; nodeVersIdx < totalVersionsIndexed; nodeVersIdx++) { + const txHash = indexedNode.versions[nodeVersIdx]?.id; + const commitId = indexedNode.versions[nodeVersIdx]?.commitId; logger.info( - `[invalidateByUuid] Deleting keys for indexed version: ${nodeVersIdx}, with txHash: ${indexedNode.versions[nodeVersIdx]?.id}`, + `[invalidateByUuid] Deleting keys for indexed version: ${nodeVersIdx}, with ${txHash ? 'txHash: ' + txHash : 'commitId: ' + commitId}`, ); const hexCid = indexedNode.versions[nodeVersIdx]?.cid || indexedNode.recentCid; const manifestCid = hexToCid(hexCid);