Skip to content

Commit 179d051

Browse files
authored
Merge pull request #225 from 4x99/develop
v1.6.2
2 parents ff75270 + e12dd1c commit 179d051

File tree

16 files changed

+129
-21
lines changed

16 files changed

+129
-21
lines changed

.env.docker-compose.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ MYSQL_PORT=3306
77
# MySQL 数据库名
88
MYSQL_DATABASE=code6
99

10-
# MySQL 用户名
10+
# MySQL 用户名(请使用非 root 用户)
1111
MYSQL_USER=
1212

1313
# MySQL 密码

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak;\
1919
echo 'deb http://mirrors.aliyun.com/debian buster main' >> /etc/apt/sources.list;\
2020
echo 'deb http://mirrors.aliyun.com/debian buster-updates main' >> /etc/apt/sources.list;\
2121
apt-get update;\
22-
apt-get install -y --allow-downgrades zip cron vim zlib1g=1:1.2.11.dfsg-1 zlib1g-dev libpng-dev;\
22+
apt-get install -y --allow-downgrades zip cron vim zlib1g=1:1.2.11.dfsg-1+deb10u1 zlib1g-dev libpng-dev;\
2323
rm -rf /var/lib/apt/lists/*;\
2424
# 安装 PHP 扩展
2525
docker-php-ext-install pdo_mysql;\

app/Console/Commands/JobRunCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public function handle()
9898
$lastResponse = ResponseMediator::getPagination($client->getLastResponse());
9999
} while ($lastResponse['next'] && (++$page <= $configJob->scan_page));
100100
$configJob->save();
101+
$job->delete();
101102
}
102103

103104
$this->log->info('Work done');
@@ -127,7 +128,6 @@ private function takeJob()
127128
if (!$job = QueueJob::orderBy('created_at')->first()) {
128129
return false;
129130
}
130-
$job->delete();
131131
return $job;
132132
}
133133

app/Http/Controllers/ConfigJobController.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace App\Http\Controllers;
44

55
use App\Models\ConfigJob;
6+
use App\Models\QueueJob;
67
use Cron\CronExpression;
78
use Illuminate\Http\Request;
89

@@ -111,6 +112,20 @@ public function batchDestroy(Request $request)
111112
}
112113
}
113114

115+
/**
116+
* 任务队列
117+
*
118+
* @return array
119+
*/
120+
public function queue()
121+
{
122+
$data = QueueJob::orderBy('created_at')->get();
123+
foreach ($data as $k => $v) {
124+
$data[$k]['status'] = $k == 0 ? 1 : 0;
125+
}
126+
return $data;
127+
}
128+
114129
/**
115130
* 下次扫描时间
116131
*

app/Services/GitHubService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct()
4444
*/
4545
public function init()
4646
{
47-
$this->proxy = $this->testProxy($this->proxy) ? $this->proxy : null;
47+
$this->proxy = $this->proxy ? ($this->testProxy($this->proxy) ? $this->proxy : null) : null;
4848
$tokens = ConfigToken::inRandomOrder()->get()->pluck('token');
4949
foreach ($tokens as $token) {
5050
$client = ['token' => $token];

composer.lock

Lines changed: 19 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/deploy-docker-compose.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ MYSQL_PORT=3306
2424
# MySQL 数据库名
2525
MYSQL_DATABASE=code6
2626
27-
# MySQL 用户名
27+
# MySQL 用户名(请使用非 root 用户)
2828
MYSQL_USER=
2929
3030
# MySQL 密码

doc/deploy-source.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ crontab -e -u <用户>
8787

8888
## 创建用户
8989
```
90-
docker exec -it code6-server /bin/bash
9190
php artisan code6:user-add <邮箱> <密码>
9291
```
9392

docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: "3.9"
22
services:
33
mysql:
4-
image: mysql/mysql-server
4+
image: mysql/mysql-server:5.7
55
container_name: code6-mysql
66
restart: always
77
env_file:

docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# 项目配置
4-
cp .env.example .env
4+
cp -i .env.example .env
55
chmod -R 755 storage
66
chown -R www-data:www-data storage
77
php artisan key:generate

0 commit comments

Comments
 (0)