File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -9,5 +9,5 @@ PREFIX="persistence"
99GAS_PRICE = " 0.025uxprt"
1010IP_WINDOW = 86400000
1111IP_DRIP_LIMIT = 10
12- FAUCET_SLEEP = 10000
12+ FAUCET_SLEEP = 2000
1313HD_PATH = " m/44'/118'/0'/0/0"
Original file line number Diff line number Diff line change @@ -49,9 +49,15 @@ async function MnemonicWalletWithPassphrase(mnemonic) {
4949
5050}
5151
52- function runner ( ) {
52+ function delay ( x ) {
53+ return new Promise ( ( done , fail ) => setTimeout ( done , x ) ) ;
54+ }
55+
56+ async function runner ( ) {
5357 console . log ( "started faucet loop" )
54- setInterval ( async function ( ) {
58+
59+ // noinspection InfiniteLoopJS
60+ while ( true ) {
5561 if ( constants . FaucetList . length > 0 ) {
5662 try {
5763 let [ wallet , addr ] = await MnemonicWalletWithPassphrase ( mnemonic ) ;
@@ -81,7 +87,8 @@ function runner() {
8187 } else {
8288 console . log ( "No Accounts to faucet" ) ;
8389 }
84- } , constants . FAUCET_SLEEP ) ;
90+ await delay ( constants . FAUCET_SLEEP ) // this allows the function to be async
91+ }
8592}
8693
8794function handleFaucetRequest ( userAddress ) {
You can’t perform that action at this time.
0 commit comments