Skip to content

Commit

Permalink
Fixed issue in cron
Browse files Browse the repository at this point in the history
  • Loading branch information
neshanth committed Jan 12, 2025
1 parent 8e3506b commit e0865c4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ protected function schedule(Schedule $schedule)
$schedule->call(function(){
$users = DB::table("users")->where("email","=","[email protected]")->get();
$userId = $users[0]->id;
$tasks = DB::table("tasks")->where("user_id","=", $userId)->get();
if(count($tasks) > 0){
DB::table("tasks")->where("user_id","=",$userId)->delete();
$tasks = [
[
Expand Down Expand Up @@ -162,8 +160,8 @@ protected function schedule(Schedule $schedule)
];

DB::table('tasks')->insert($tasks);
}
})->daily();

})->everyMinute();
}

/**
Expand Down

0 comments on commit e0865c4

Please sign in to comment.