Skip to content

Commit

Permalink
Merge pull request #368 from czqoocavatsim/JoshuaBranch
Browse files Browse the repository at this point in the history
Increase Script Timer
  • Loading branch information
JoshuaMicallefYBSU authored Oct 20, 2024
2 parents 2df4074 + cdfaae0 commit 048ea70
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Training/ApplicationsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public function apply(Request $request)
return view('training.applications.apply')->with('allowed', 'rating');
}

// Redirect if user is not a member of the Discord
if(auth()->user()->member_of_czqo == 0){

return view('training.applications.apply')->with('allowed', 'discord');
}

Expand Down
16 changes: 13 additions & 3 deletions app/Jobs/DiscordAccountCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class DiscordAccountCheck implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

public $timeout = 1400;
public $timeout = 3000;

/**
* Execute the job.
Expand All @@ -34,7 +34,7 @@ class DiscordAccountCheck implements ShouldQueue
public function handle()
{
// Timeout length (seconds)
ini_set('max_execution_time', 1400);
ini_set('max_execution_time', 3000);

// Script Start Time
$start_time = Carbon::now();
Expand Down Expand Up @@ -73,7 +73,7 @@ public function handle()
}

// Add a Sleep Timer - Allows API to not block
sleep(6);
sleep(2);

// Check if user is currently in Discord
if (in_array($user->discord_user_id, $discord_uids)) {
Expand Down Expand Up @@ -144,6 +144,16 @@ public function handle()
array_push($rolesToAdd, $discordRoleIds['shanwick_certified']);
}

//Enroute Controller
if($user->rating_short == 'C1'){
array_push($rolesToAdd, $discordRoleIds['enroute']);
}

//Enroute Controller
if($user->rating_short == 'C3'){
array_push($rolesToAdd, $discordRoleIds['senior_enroute']);
}

//Supervisor?
if ($user->rating_short == 'SUP') {
array_push($rolesToAdd, $discordRoleIds['supervisor']);
Expand Down

0 comments on commit 048ea70

Please sign in to comment.