Commit 2809e8f6 authored by Sean O'Donnell's avatar Sean O'Donnell

Added a sleep 60 when getting a 429 response

parent aa2c6fb1
......@@ -136,8 +136,11 @@ class ListenController extends Controller
));
curl_setopt($ch, CURLOPT_HEADER, 1);
$response = curl_exec($ch);
Log::info($response);
$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if($http_status == '429'){
sleep(60);
}
}
}
......
......@@ -41,11 +41,9 @@ class ProcessProcesses implements ShouldQueue
$id = $this->id;
/////////////////////////////////
$processes = Processes::where('id', $id)->first();
Log::info("Processing " . $id);
$games = Array();
if(!isset($processes->processes))
{
Log::info("Unable to process " . $id);
return false;
}
......@@ -58,7 +56,6 @@ class ProcessProcesses implements ShouldQueue
// Search the games for the activity
foreach($games as $g)
{
Log::info("GameID: " . $g->id . " UserID: " . $processes->user_id);
$activity = Activity::where('game_id', '=', $g->id)->where('user_id', '=', $processes->user_id)->first();
// Dispatch a job to go send an update to twitch
if($activity)
......
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class FollowerProcessed extends Notification
{
use Queueable;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->line('The introduction to the notification.')
->action('Notification Action', url('/'))
->line('Thank you for using our application!');
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
//
];
}
public function toSlack()
{
return (new SlackMessage)
->from('Production')
->to('#notify-followers')
->content('Someone just Followed');
}
}
......@@ -16,7 +16,7 @@ class UserFollow extends Model
public function routeNotificationForSlack($notification)
{
//return 'https://hooks.slack.com/services/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';
return 'https://hooks.slack.com/services/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';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment