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