diff --git a/server/utils/common.ts b/server/utils/common.ts index 32e8c4a..a0eb103 100644 --- a/server/utils/common.ts +++ b/server/utils/common.ts @@ -248,6 +248,7 @@ const latestBlockDetails = async()=> { return(err_msg); }); + /* // const space = await exec('du -sh /root/.epic/main/chain_data/ --exclude=*.zip'); const space = "1.7G /var/www/html/" // let disk_space = space.stdout.split('\t')[0]; @@ -258,6 +259,13 @@ const latestBlockDetails = async()=> { //let disk_space_kb = space_new.stdout.split('\t')[0]; // let disk_space_kb = (space_new.stdout.split('\t')[0] / 1000000).toFixed(2)+"G"; let disk_space_kb = "1.7G" + */ + const space = await exec('du -sh /root/.epic/main/chain_data/ --exclude=*.zip'); + let disk_space = space.stdout.split('\t')[0]; + const space_new = await exec('du -sk /root/.epic/main/chain_data/ --exclude=*.zip'); + //let disk_space_kb = space_new.stdout.split('\t')[0]; + let disk_space_kb = (space_new.stdout.split('\t')[0] / 1000000).toFixed(2)+"G"; + let height = BlockchainLatestBlockQuery[0].height; var coin_existence; let DAY_HEIGHT = 1440 @@ -456,6 +464,7 @@ const previousBlockDetails = async() => { return(err_msg); }); + /* // const space = await exec('du -sh /root/.epic/main/chain_data/ --exclude=*.zip'); const space = "1.7G /var/www/html/" // let disk_space = space.stdout.split('\t')[0]; @@ -466,6 +475,13 @@ const previousBlockDetails = async() => { //let disk_space_kb = space_new.stdout.split('\t')[0]; // let disk_space_kb = (space_new.stdout.split('\t')[0] / 1000000).toFixed(2)+"G"; let disk_space_kb = "1.7G" + */ + const space = await exec('du -sh /root/.epic/main/chain_data/ --exclude=*.zip'); + let disk_space = space.stdout.split('\t')[0]; + const space_new = await exec('du -sk /root/.epic/main/chain_data/ --exclude=*.zip'); + //let disk_space_kb = space_new.stdout.split('\t')[0]; + let disk_space_kb = (space_new.stdout.split('\t')[0] / 1000000).toFixed(2)+"G"; + let height = BlockchainLatestBlockQuery[0].height; var coin_existence; let DAY_HEIGHT = 1440