scheduling task
This commit is contained in:
@@ -30,8 +30,9 @@ class Kernel extends ConsoleKernel
|
|||||||
protected function schedule(Schedule $schedule)
|
protected function schedule(Schedule $schedule)
|
||||||
{
|
{
|
||||||
if (env('DB_INSTALL') == 1) {
|
if (env('DB_INSTALL') == 1) {
|
||||||
$queue = $this->getCurrentQueue();
|
if ($this->getCurrentQueue() != "sync") {
|
||||||
$schedule->command('queue:listen '.$queue, ['--tries' => 1])->everyMinute();
|
$schedule->command('queue:listen '.$this->getCurrentQueue().' --sleep 60')->everyMinute();
|
||||||
|
}
|
||||||
$this->execute($schedule, 'fetching');
|
$this->execute($schedule, 'fetching');
|
||||||
$this->execute($schedule, 'notification');
|
$this->execute($schedule, 'notification');
|
||||||
$this->execute($schedule, 'work');
|
$this->execute($schedule, 'work');
|
||||||
@@ -61,34 +62,34 @@ class Kernel extends ConsoleKernel
|
|||||||
$at = $command['at'];
|
$at = $command['at'];
|
||||||
switch ($condition) {
|
switch ($condition) {
|
||||||
case 'everyMinute':
|
case 'everyMinute':
|
||||||
$schedule->everyMinute()->withoutOverlapping();
|
$schedule->everyMinute();
|
||||||
break;
|
break;
|
||||||
case 'everyFiveMinutes':
|
case 'everyFiveMinutes':
|
||||||
$schedule->everyFiveMinutes()->withoutOverlapping();
|
$schedule->everyFiveMinutes();
|
||||||
break;
|
break;
|
||||||
case 'everyTenMinutes':
|
case 'everyTenMinutes':
|
||||||
$schedule->everyTenMinutes()->withoutOverlapping();
|
$schedule->everyTenMinutes();
|
||||||
break;
|
break;
|
||||||
case 'everyThirtyMinutes':
|
case 'everyThirtyMinutes':
|
||||||
$schedule->everyThirtyMinutes()->withoutOverlapping();
|
$schedule->everyThirtyMinutes();
|
||||||
break;
|
break;
|
||||||
case 'hourly':
|
case 'hourly':
|
||||||
$schedule->hourly()->withoutOverlapping();
|
$schedule->hourly();
|
||||||
break;
|
break;
|
||||||
case 'daily':
|
case 'daily':
|
||||||
$schedule->daily()->withoutOverlapping();
|
$schedule->daily();
|
||||||
break;
|
break;
|
||||||
case 'dailyAt':
|
case 'dailyAt':
|
||||||
$this->getConditionWithOption($schedule, $condition, $at);
|
$this->getConditionWithOption($schedule, $condition, $at);
|
||||||
break;
|
break;
|
||||||
case 'weekly':
|
case 'weekly':
|
||||||
$schedule->weekly()->withoutOverlapping();
|
$schedule->weekly();
|
||||||
break;
|
break;
|
||||||
case 'monthly':
|
case 'monthly':
|
||||||
$schedule->monthly()->withoutOverlapping();
|
$schedule->monthly();
|
||||||
break;
|
break;
|
||||||
case 'yearly':
|
case 'yearly':
|
||||||
$schedule->yearly()->withoutOverlapping();
|
$schedule->yearly();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -97,7 +98,7 @@ class Kernel extends ConsoleKernel
|
|||||||
{
|
{
|
||||||
switch ($command) {
|
switch ($command) {
|
||||||
case 'dailyAt':
|
case 'dailyAt':
|
||||||
$schedule->dailyAt($at)->withoutOverlapping();
|
$schedule->dailyAt($at);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -11,10 +11,9 @@ use Lang;
|
|||||||
use RecursiveDirectoryIterator;
|
use RecursiveDirectoryIterator;
|
||||||
use RecursiveIteratorIterator;
|
use RecursiveIteratorIterator;
|
||||||
|
|
||||||
class SettingsController extends Controller
|
class SettingsController extends Controller {
|
||||||
{
|
|
||||||
public function settingsIcon()
|
public function settingsIcon() {
|
||||||
{
|
|
||||||
return ' <div class="col-md-2 col-sm-6">
|
return ' <div class="col-md-2 col-sm-6">
|
||||||
<div class="settingiconblue">
|
<div class="settingiconblue">
|
||||||
<div class="settingdivblue">
|
<div class="settingdivblue">
|
||||||
@@ -29,8 +28,7 @@ class SettingsController extends Controller
|
|||||||
</div>';
|
</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function settings()
|
public function settings() {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
$settings = new CommonSettings();
|
$settings = new CommonSettings();
|
||||||
$directories = $this->directories();
|
$directories = $this->directories();
|
||||||
@@ -51,8 +49,7 @@ class SettingsController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function postSettings(Request $request)
|
public function postSettings(Request $request) {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
$requests = $request->except('_token');
|
$requests = $request->except('_token');
|
||||||
$this->delete();
|
$this->delete();
|
||||||
@@ -70,8 +67,7 @@ class SettingsController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete()
|
public function delete() {
|
||||||
{
|
|
||||||
$settings = CommonSettings::where('option_name', 'storage')->get();
|
$settings = CommonSettings::where('option_name', 'storage')->get();
|
||||||
if ($settings->count() > 0) {
|
if ($settings->count() > 0) {
|
||||||
foreach ($settings as $setting) {
|
foreach ($settings as $setting) {
|
||||||
@@ -80,8 +76,7 @@ class SettingsController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function save($key, $value)
|
public function save($key, $value) {
|
||||||
{
|
|
||||||
CommonSettings::create([
|
CommonSettings::create([
|
||||||
'option_name' => 'storage',
|
'option_name' => 'storage',
|
||||||
'optional_field' => $key,
|
'optional_field' => $key,
|
||||||
@@ -89,8 +84,7 @@ class SettingsController extends Controller
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function directories($root = '')
|
public function directories($root = '') {
|
||||||
{
|
|
||||||
if ($root == '') {
|
if ($root == '') {
|
||||||
$root = base_path();
|
$root = base_path();
|
||||||
}
|
}
|
||||||
@@ -109,14 +103,13 @@ class SettingsController extends Controller
|
|||||||
return $paths;
|
return $paths;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function attachment()
|
public function attachment() {
|
||||||
{
|
|
||||||
$storage = new StorageController();
|
$storage = new StorageController();
|
||||||
$storage->upload();
|
$storage->upload();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function activate()
|
public function activate() {
|
||||||
{
|
if (!\Schema::hasColumn('ticket_attachment', 'driver')) {
|
||||||
$path = 'app' . DIRECTORY_SEPARATOR . 'FaveoStorage' . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . 'migrations';
|
$path = 'app' . DIRECTORY_SEPARATOR . 'FaveoStorage' . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . 'migrations';
|
||||||
Artisan::call('migrate', [
|
Artisan::call('migrate', [
|
||||||
'--path' => $path,
|
'--path' => $path,
|
||||||
@@ -124,3 +117,5 @@ class SettingsController extends Controller
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@@ -326,14 +326,19 @@ class TemplateController extends Controller
|
|||||||
if (!$from_address) {
|
if (!$from_address) {
|
||||||
throw new Exception('Sorry! We can not find your request');
|
throw new Exception('Sorry! We can not find your request');
|
||||||
}
|
}
|
||||||
$controller = new PhpMailController();
|
$to_address = [
|
||||||
$controller->setMailConfig($from_address);
|
'name' => "",
|
||||||
$controller->laravelMail($to, '', $subject, $msg, [], null);
|
'email' => $to
|
||||||
|
];
|
||||||
|
$message = [
|
||||||
|
'subject' => $subject,
|
||||||
|
'scenario' => null,
|
||||||
|
'body' => $msg
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->PhpMailController->sendmail($from, $to_address, $message,[],[]);
|
||||||
return redirect()->back()->with('success', 'Mail has send successfully');
|
return redirect()->back()->with('success', 'Mail has send successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
dd($e);
|
|
||||||
|
|
||||||
return redirect()->back()->with('fails', $e->getMessage());
|
return redirect()->back()->with('fails', $e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
<type>org.netbeans.modules.php.project</type>
|
<type>org.netbeans.modules.php.project</type>
|
||||||
<configuration>
|
<configuration>
|
||||||
<data xmlns="http://www.netbeans.org/ns/php-project/1">
|
<data xmlns="http://www.netbeans.org/ns/php-project/1">
|
||||||
<name>Faveo-Helpdesk-Pro-bhanu-fork</name>
|
<name>faveo-helpdesk-community</name>
|
||||||
</data>
|
</data>
|
||||||
</configuration>
|
</configuration>
|
||||||
</project>
|
</project>
|
||||||
|
Reference in New Issue
Block a user