Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
crawler.vmusicchart.vn
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Phạm Văn Đoan
crawler.vmusicchart.vn
Commits
82dcab0a
Commit
82dcab0a
authored
Mar 12, 2020
by
Phạm Văn Đoan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tạo Crontjob.php test
parent
306fdb5b
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
10 deletions
+81
-10
.env
.env
+10
-3
.gitignore
.gitignore
+1
-0
CrontjobCommand.php
app/Console/Commands/CrontjobCommand.php
+44
-0
Kernel.php
app/Console/Kernel.php
+6
-1
Crontjob.php
app/Models/Crontjob.php
+14
-0
database.php
config/database.php
+6
-6
No files found.
.env
View file @
82dcab0a
...
...
@@ -6,11 +6,18 @@ APP_LOG_LEVEL=debug
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
DB_DATABASE=vmusicchart
DB_USERNAME=vmusic
DB_PASSWORD=Vmusic@2019###
DB_LOCAL_HOST=127.0.0.1
DB_LOCAL_PORT=3306
DB_LOCAL_DATABASE=vmusicchart
DB_LOCAL_USERNAME=root
DB_LOCAL_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
...
...
.gitignore
View file @
82dcab0a
...
...
@@ -8,3 +8,4 @@
Homestead.json
Homestead.yaml
.env
/composer.lock
app/Console/Commands/CrontjobCommand.php
0 → 100644
View file @
82dcab0a
<?php
namespace
App\Console\Commands
;
use
App\Models\Crontjob
;
use
Carbon\Carbon
;
use
Illuminate\Console\Command
;
class
CrontjobCommand
extends
Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected
$signature
=
'crontjob:test'
;
/**
* The console command description.
*
* @var string
*/
protected
$description
=
'Command description'
;
/**
* Create a new command instance.
*
* @return void
*/
public
function
__construct
()
{
parent
::
__construct
();
}
/**
* Execute the console command.
*
* @return mixed
*/
public
function
handle
()
{
Crontjob
::
create
([
'message'
=>
'Crontjob is called at '
.
Carbon
::
now
()]);
}
}
app/Console/Kernel.php
View file @
82dcab0a
...
...
@@ -2,6 +2,7 @@
namespace
App\Console
;
use
App\Console\Commands\CrontjobCommand
;
use
Illuminate\Console\Scheduling\Schedule
;
use
Illuminate\Foundation\Console\Kernel
as
ConsoleKernel
;
...
...
@@ -13,7 +14,7 @@ class Kernel extends ConsoleKernel
* @var array
*/
protected
$commands
=
[
//
CrontjobCommand
::
class
,
];
/**
...
...
@@ -26,6 +27,10 @@ class Kernel extends ConsoleKernel
{
// $schedule->command('inspire')
// ->hourly();
$schedule
->
command
(
'crontjob:test'
)
->
everyMinute
();
$schedule
->
command
(
'queue:work --once --timeout=120'
)
->
everyMinute
()
->
withoutOverlapping
();
}
/**
...
...
app/Models/Crontjob.php
0 → 100644
View file @
82dcab0a
<?php
namespace
App\Models
;
use
Illuminate\Database\Eloquent\Model
;
class
Crontjob
extends
Model
{
protected
$table
=
'crontjobs'
;
public
$timestamps
=
true
;
protected
$fillable
=
[
'message'
];
}
config/database.php
View file @
82dcab0a
...
...
@@ -41,16 +41,16 @@ return [
'mysql'
=>
[
'driver'
=>
'mysql'
,
'host'
=>
env
(
'DB_HOST'
,
'127.0.0.1
'
),
'port'
=>
env
(
'DB_PORT'
,
'3306
'
),
'database'
=>
env
(
'DB_DATABASE'
,
'forge
'
),
'username'
=>
env
(
'DB_USERNAME'
,
'forge
'
),
'password'
=>
env
(
'DB_PASSWORD'
,
'
'
),
'host'
=>
(
env
(
'APP_ENV'
)
==
'production'
)
?
env
(
'DB_HOST'
)
:
env
(
'DB_LOCAL_HOST
'
),
'port'
=>
(
env
(
'APP_ENV'
)
==
'production'
)
?
env
(
'DB_PORT'
)
:
env
(
'DB_LOCAL_PORT
'
),
'database'
=>
(
env
(
'APP_ENV'
)
==
'production'
)
?
env
(
'DB_DATABASE'
)
:
env
(
'DB_LOCAL_DATABASE
'
),
'username'
=>
(
env
(
'APP_ENV'
)
==
'production'
)
?
env
(
'DB_USERNAME'
)
:
env
(
'DB_LOCAL_USERNAME
'
),
'password'
=>
(
env
(
'APP_ENV'
)
==
'production'
)
?
env
(
'DB_PASSWORD'
)
:
env
(
'DB_LOCAL_PASSWORD
'
),
'unix_socket'
=>
env
(
'DB_SOCKET'
,
''
),
'charset'
=>
'utf8mb4'
,
'collation'
=>
'utf8mb4_unicode_ci'
,
'prefix'
=>
''
,
'strict'
=>
tru
e
,
'strict'
=>
fals
e
,
'engine'
=>
null
,
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment