<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                [TOC] ## 環境 Centos ### 配置supervisor實現進程守護 #### 1.安裝supervisor ~~~ yum install Supervisor ~~~ #### 2.啟動服務 ~~~ supervisord -c /etc/supervisord.conf ~~~ 進入 cd /etc 目錄 找到supervisord.conf 配置文件 和 supervisord.d 文件夾,使用vim編輯supervisord.conf文件,拉到最底部我們可以看到 ![](https://img.kancloud.cn/cd/ab/cdab86f7f44629ad43e893fd10c85b0d_575x142.png) files = supervisord.d/\*.ini?這句代碼說明它會加載supervisord.d文件夾中的所有.ini配置文件 #### 3.編輯配置文件 隨后我們在supervosprd.d中創建一個:blog-work.ini文件并編輯如下 ~~~ [program:blog-work] process_name=%(program_name)s_%(process_num)02d command=/usr/local/php/bin/php /www/blog/artisan queue:work database --sleep=3 --tries=3 --daemon autostart=true autorestart=true user=root numprocs=2 redirect_stderr=true stdout_logfile=/www/blog/storage/logs/queue.log ~~~ #### 4.重載配置文件 執行命令使用心得配置文件運行supervisor服務 ~~~ supervisorctl reload //重新加載配置文件 ~~~ : 更多詳細操作 參見 [supervisor章節](http://www.hmoore.net/macho_wml/macho/2388246) ## 先根據laravel文檔 進行一番配置 ### 數據庫 > 要使用 database 隊列驅動程序,你需要一個數據庫表來保存任務。要生成創建此表的遷移,請運行 queue:table Artisan 命令。一旦遷移已經創建,你可以使用 migrate 命令遷移你的數據庫: php artisan queue:table php artisan migrate ### **代碼邏輯** #### 1.創建一個隊列 `php artisan make:job TestJob` > 終端執行上面命令 會app/job生成一個TestJob類 ![](https://img.kancloud.cn/07/9b/079b389c68c9a869a9f92f42dabf2d08_1031x823.png) ### 2.調用隊列 ![](https://img.kancloud.cn/9e/b3/9eb39a19a1e3bfc471c180fc5ed8bae6_619x109.png) ### 3.本地終端測試 `php artisan queue:listen` ![](https://img.kancloud.cn/b5/f6/b5f6150eaf1b7f0a5db611fcb64092ff_560x541.png) ### 4.常用命令 ~~~ php artisan queue:retry all php artisan queue:failed php artisan queue:listen php artisan queue:retry edbc7cae-44d7-44b6-9c2b-14a310c07ed6 ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看