Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mouday committed Apr 18, 2024
1 parent 2946082 commit 6ae7146
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 11 deletions.
73 changes: 63 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
# Cron Admin

基于Golang + React.js 的定时任务管理平台
一个零依赖的基于Golang + React.js 的定时任务管理平台

https://zhuanlan.zhihu.com/p/480841357

- 后端代码:https://github.com/mouday/cron-admin
- 前端代码:https://github.com/mouday/cron-admin-web

如果需要前端代码,issue中 留下github用户名,我会将代码权限分享给你

基本逻辑执行任务:同步调用,同步返回
基本逻辑执行任务:通过api同步调用,同步返回

Cron Admin 仅负责定时任务的调度,不负责定时任务的执行

Expand All @@ -19,12 +12,72 @@ Cron Admin 仅负责定时任务的调度,不负责定时任务的执行
- Golang: Gin
- Node.js: Koa、Express
- Java: Spring Boot
- ...

## 项目截图

![](https://cdn.jsdelivr.net/gh/mouday/img/2024/04/18/t3qfbrg.png)

![](https://cdn.jsdelivr.net/gh/mouday/img/2024/04/18/sfofgut.png)

## 安装

下载对应平台的可以执行文件,运行即可,不需要安装任何依赖

1、下载适合所在运行平台的二进制文件

[https://github.com/mouday/cron-admin/releases](https://github.com/mouday/cron-admin/releases)

3、解压文件并启动服务

```bash
export GIN_MODE=release
# macos:
./cron-admin

# linux:
./cron-admin

# windows:
cron-admin.exe
```

启动后控制台会输出如下内容

```
username: admin
password: 8),fua+jMN
********************************************
* Welcome Use Cron Admin v1.0.0
* server run at: http://127.0.0.1:8000
* issue: https://github.com/mouday/cron-admin
********************************************
```

查看控制台输出的账号密码,即可登录应用

默认地址:http://127.0.0.1:8000

## 配置文件

可以使用默认配置,也可以自定义配置

```bash
cp env.example .env
```

配置说明

```bash
# == 应用配置 ==
# 运行模式 debug test release (默认:release)
GIN_MODE=release

# 监听端口 (默认:127.0.0.1:8000)
APP_RUN_ADDRESS=127.0.0.1:8000

# == 账号配置 ==
# 管理员账号
APP_ADMIN_USERNAME=admin
# 管理员密码
APP_ADMIN_PASSWORD=
```
2 changes: 1 addition & 1 deletion src/config/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func GetEnv() string {

if env == "" {
// env = "release"
env = "debug"
env = "release"
}

return env
Expand Down
2 changes: 2 additions & 0 deletions src/service/cron_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ func InitCron() {
}
}

// https://zhuanlan.zhihu.com/p/480841357

// 容器
var CronArray sync.Map

Expand Down

0 comments on commit 6ae7146

Please sign in to comment.