Skip to content

Commit

Permalink
Merge pull request #33 from CronCats/shardnet
Browse files Browse the repository at this point in the history
fix bugs
  • Loading branch information
TrevorJTClarke authored Jul 19, 2022
2 parents 0910c62 + c8b5712 commit eeb3999
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "croncat",
"version": "1.8.1",
"version": "1.8.2",
"description": "cron.cat CLI and Agent Runner",
"main": "src/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function getAgentBalance() {
return balance
} catch (e) {
console.log(`${chalk.red('NEAR RPC Failed')}`)
await utils.notifySlack(`*Attention!* NEAR ${near_env} RPC Failed to retrieve balance!`)
await util.notifySlack(`*Attention!* NEAR ${near_env} RPC Failed to retrieve balance!`)
process.exit(1)
}
}
Expand Down
14 changes: 7 additions & 7 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const notifySlack = text => {
text
})
} catch (e) {
util.dbug('notifySlack', e);
dbug('notifySlack', e);
}
}

Expand All @@ -28,7 +28,7 @@ export const pingHeartbeat = async () => {
try {
await axios.get(config.HEARTBEAT_URL)
} catch (e) {
util.dbug('pingHeartbeat', e);
dbug('pingHeartbeat', e);
}
}
return Promise.resolve()
Expand Down Expand Up @@ -66,7 +66,7 @@ export const Near = new NearProvider({
networkId: config.NODE_ENV === 'production' ? 'mainnet' : config.NODE_ENV || 'testnet',
accountId: config.AGENT_ACCOUNT_ID,
})
util.dbug('Near OBJ', Near);
dbug('Near OBJ', Near);

export const queryRpc = async (account_id, method_name, args, options = {}, args_base64) => {
// load contract based on abis & type
Expand All @@ -83,7 +83,7 @@ export const queryRpc = async (account_id, method_name, args, options = {}, args
args_base64: args_base64 || btoa(JSON.stringify(args || {}))
})
} catch (e) {
util.dbug('queryRpc', e)
dbug('queryRpc', e)
}

return options && typeof options.request_type !== 'undefined' ? res : parseResponse(res.result)
Expand All @@ -93,12 +93,12 @@ export const queryRpc = async (account_id, method_name, args, options = {}, args
let cronManager = null

export async function connect(options) {
util.dbug('connect options', options);
dbug('connect options', options);
try {
await Near.getNearConnection(options)
} catch (e) {
log(`${chalk.red('NEAR Connection Failed')}`)
util.dbug('near connect', e);
dbug('near connect', e);
// TODO: Retry with diff Provider before hard exit
process.exit(1)
}
Expand Down Expand Up @@ -138,6 +138,6 @@ export async function getCroncatInfo() {
agent_storage_usage: res[14],
}
} catch (e) {
util.dbug('getCroncatInfo', e);
dbug('getCroncatInfo', e);
}
}

0 comments on commit eeb3999

Please sign in to comment.