This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| await retryTimeout(() => async () => { | |
| await retryGoTo(() => page.goto(url, {timeout:120000,waitUntil: 'networkidle0'}),3, 20000); | |
| await page.waitForSelector('html',{timeout:timeout_value}) | |
| await page.waitForSelector('div.controls', {timeout:5000}); | |
| await page.click('button.action-force',{delay:helpers.getRandomInt(100, 500)}); | |
| await page.waitFor(time*1000); | |
| isPlayed=true; | |
| return isPlayed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| main() { | |
| pm2-docker start ${BOT_NAME}.json & | |
| # Setup signal handler | |
| trap 'sigtermHandler' SIGTERM | |
| sleep 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function handleSignals(){ | |
| helpers.log(p_id,`------------SIGINT Detected!1-------------`); | |
| request(`${webdomain}/api/p/end/${p_id}`,{ | |
| method: 'POST', | |
| form: { | |
| error: '', | |
| msg:'SIGINT DETECTED!' | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function handleSignals(){ | |
| helpers.log(p_id,`------------SIGINT Detected1!-------------`); | |
| helpers.log(p_id,`------------SIGINT Detected2!-------------`); | |
| req.post(`${webdomain}/api/p_id/end/${p_id}`, {form:{error:'',msg:'SIGINT DETECTED!'}}, function(err, res, body) { | |
| helpers.log(p_id,`------------SIGINT Detected3!-------------`); | |
| }); | |
| helpers.log(p_id,`------------SIGINT Detected4!-------------`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| hmp-Mac-Pro:node-bts hmp$ node app.js | |
| Process ID 91698 - Session Id 6c8cb9f0-c0ac-11e8-804f-e51a738ea396 - 2018.09.25 11:19:02 - Initialising Call | |
| Process ID 91698 - Session Id 6c8cb9f0-c0ac-11e8-804f-e51a738ea396 - 2018.09.25 11:20:05 - Trying to login with Account ID XXX | |
| Process ID 91698 - Session Id 6c8cb9f0-c0ac-11e8-804f-e51a738ea396 - 2018.09.25 11:20:18 - Login Success! | |
| Process ID 91698 - Session Id 6c8cb9f0-c0ac-11e8-804f-e51a738ea396 - 2018.09.25 11:20:20 - Trying to Open URL | |
| Process ID 91698 - Session Id 6c8cb9f0-c0ac-11e8-804f-e51a738ea396 - 2018.09.25 11:20:45 - Scraping for 35 secs | |
| ^CProcess ID 91698 - Session Id 6c8cb9f0-c0ac-11e8-804f-e51a738ea396 - 2018.09.25 11:20:55 - ------------SIGINT Detected1!------------- | |
| Process ID 91698 - Session Id 6c8cb9f0-c0ac-11e8-804f-e51a738ea396 - 2018.09.25 11:20:55 - ------------SIGINT Detected2!------------- | |
| Process ID 91698 - Session Id 6c8cb9f0-c0ac-11e8-804f-e51a738ea396 - 2018.09.25 11:20:55 - ------------SIGINT Detected4!------------- | |
| hmp-Mac-Pro:node-b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function asyncStuff() { | |
| return new Promise((resolve, reject) => { | |
| console.log('call api') | |
| req.post(`${webdomain}/api/p_id/end/${p_id}`) | |
| setTimeout(() => resolve("finished"), 2000); | |
| }); | |
| } | |
| function killedHandler() { | |
| console.log("killedHandler called"); | |
| asyncStuff().then(console.log('bye') ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Models; | |
| use Illuminate\Database\Eloquent\Model; | |
| class CampaignPlay extends Model | |
| { | |
| public $primaryKey = false; | |
| public $incrementing = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| root@bt-web-api-76fc4845-m5m27:/var/log# tail -f /var/log/syslog | grep cron -i | |
| Sep 28 10:09:01 bt-web-api-76fc4845-m5m27 CRON[17997]: (root) CMD (/usr/local/bin/php /var/www/artisan schedule:run >> /dev/null 2>&1) | |
| Sep 28 10:09:18 bt-web-api-76fc4845-m5m27 cron[18050]: (CRON) INFO (pidfile fd = 3) | |
| Sep 28 10:09:18 bt-web-api-76fc4845-m5m27 cron[18051]: (CRON) STARTUP (fork ok) | |
| Sep 28 10:09:18 bt-web-api-76fc4845-m5m27 cron[18051]: (CRON) INFO (Skipping @reboot jobs -- not system startup) | |
| Sep 28 10:10:01 bt-web-api-76fc4845-m5m27 CRON[18074]: (root) CMD (/usr/local/bin/php /var/www/artisan schedule:run >> /dev/null 2>&1) | |
| Sep 28 10:11:01 bt-web-api-76fc4845-m5m27 CRON[18099]: (root) CMD (/usr/local/bin/php /var/www/artisan schedule:run >> /dev/null 2>&1) | |
| Sep 28 10:12:01 bt-web-api-76fc4845-m5m27 CRON[18113]: (root) CMD (/usr/local/bin/php /var/www/artisan schedule:run >> /dev/null 2>&1) | |
| Sep 28 10:13:01 bt-web-api-76fc4845-m5m27 CRON[18127]: (root) CMD (/usr/local/bin/php /var/www/artisan schedule:run >> /dev/nul |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| knex('campaigns') | |
| .leftJoin('campaign_plays', function() { | |
| this.on('campaigns.id', '=','campaign_plays.campaign_id') | |
| .on('campaign_plays.campaign_date', '=', knex.raw('?', [today])) | |
| }) | |
| .where('campaigns.start_date', '<=', today) | |
| .where('campaigns.end_date', '>=', today) | |
| .where('campaigns.status', '=', 'RUNNING') | |
| .whereRaw('IFNULL(campaign_plays.play_count, 0) < campaigns.daily_goal') | |
| .count('id as count') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| redisKeyExist = redis.exists(`alock:${req.query.service_id}:${req.query.account_id}`, function(err, exist) { | |
| return exist | |
| }) | |
| console.log(redisKeyExist) |