mirror of
https://github.com/Xahau/Validation-Ledger-Tx-Store-to-xPOP.git
synced 2025-11-20 11:45:51 +00:00
Fix counter stuck & not gen pregen xpop
This commit is contained in:
@@ -58,7 +58,7 @@ services:
|
||||
healthcheck:
|
||||
test: TTL_MINUTES_PREGEN_XPOP=${TTL_MINUTES_PREGEN_XPOP:-60} TTL_DAYS_XPOP_SOURCE_FILES=${TTL_DAYS_XPOP_SOURCE_FILES:-30} sh /cleanup.sh
|
||||
interval: ${TTL_MINUTES_CLEANUP_INTERVAL:-60}m
|
||||
retries: 0
|
||||
retries: 10
|
||||
timeout: 55m
|
||||
volumes:
|
||||
nginxcache:
|
||||
|
||||
@@ -2,6 +2,7 @@ import { writeFile } from 'fs'
|
||||
import { dirExists } from './dirExists.mjs'
|
||||
import { ledgerIndexToFolders } from './ledgerIndexToFolders.mjs'
|
||||
import { xpopGenerate } from './xpopGenerate.mjs'
|
||||
import { createDirectory } from './createDirectory.mjs'
|
||||
import { waitForLedgerReady } from './events/ledgerReady.mjs'
|
||||
import { emit } from '../bin/webserver.mjs'
|
||||
import 'dotenv/config'
|
||||
@@ -68,7 +69,13 @@ const onTransaction = async ({
|
||||
networkId,
|
||||
txHash: tx.hash,
|
||||
})
|
||||
if (await dirExists(xpopBinaryDir)) {
|
||||
|
||||
|
||||
if (!(await dirExists(xpopBinaryDir))) {
|
||||
console.log('(Re-) creating /store/xpop directory')
|
||||
await createDirectory('store/xpop')
|
||||
}
|
||||
|
||||
const xpopWritten = await new Promise(resolve => {
|
||||
writeFile(xpopBinaryDir + '/' + tx.hash, Buffer.from(xpopBinary, 'utf8'), err => {
|
||||
if (err) {
|
||||
@@ -115,7 +122,6 @@ const onTransaction = async ({
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export {
|
||||
|
||||
Reference in New Issue
Block a user