2021-07-11 09:37:39 +00:00
|
|
|
# dataupdater
|
2020-08-24 10:38:52 +00:00
|
|
|
|
2021-07-11 09:37:39 +00:00
|
|
|
- Adds new servers automatically.
|
2021-05-03 14:40:13 +00:00
|
|
|
- Fetches and updates server data (players, tribes, ODA, ODD, ODS, OD, conquers, configs).
|
2020-10-10 06:49:18 +00:00
|
|
|
- Saves daily player/tribe stats, player/tribe history, tribe changes, player name changes, server stats.
|
2021-05-03 14:40:13 +00:00
|
|
|
- Clears database from old player/tribe stats, player/tribe history.
|
2020-08-24 10:38:52 +00:00
|
|
|
|
|
|
|
## Development
|
|
|
|
|
2021-06-06 17:01:35 +00:00
|
|
|
### Prerequisites
|
|
|
|
|
|
|
|
1. Golang
|
|
|
|
2. PostgreSQL
|
|
|
|
3. Redis
|
|
|
|
|
|
|
|
### Installation
|
2021-05-06 13:06:38 +00:00
|
|
|
**Required ENV variables:**
|
2020-06-01 19:05:33 +00:00
|
|
|
|
|
|
|
```
|
2020-08-24 10:38:52 +00:00
|
|
|
DB_USER=your_db_user
|
|
|
|
DB_NAME=your_db_name
|
2020-06-01 19:05:33 +00:00
|
|
|
DB_PORT=5432
|
2020-08-24 10:38:52 +00:00
|
|
|
DB_HOST=your_db_host
|
|
|
|
DB_PASSWORD=your_db_pass
|
2020-10-10 09:45:52 +00:00
|
|
|
|
2021-04-25 18:24:26 +00:00
|
|
|
REDIS_ADDR=redis_addr
|
|
|
|
REDIS_DB=redis_db
|
|
|
|
REDIS_USER=redis_user
|
|
|
|
REDIS_PASSWORD=redis_password
|
|
|
|
|
2021-04-27 16:30:12 +00:00
|
|
|
RUN_ON_INIT=true|false
|
2021-04-25 18:24:26 +00:00
|
|
|
LOG_DB_QUERIES=true|false
|
|
|
|
|
2021-04-27 18:06:38 +00:00
|
|
|
WORKER_LIMIT=1
|
2020-06-01 19:05:33 +00:00
|
|
|
```
|
2020-08-24 10:38:52 +00:00
|
|
|
|
|
|
|
1. Clone this repo.
|
2021-06-06 17:01:35 +00:00
|
|
|
```
|
|
|
|
git clone git@github.com:tribalwarshelp/cron.git
|
|
|
|
```
|
2021-06-19 15:01:22 +00:00
|
|
|
2. Open the folder with this project in a terminal.
|
2021-04-27 18:06:38 +00:00
|
|
|
3. Set the required env variables directly in your system or create .env.local file.
|
2021-07-11 09:04:51 +00:00
|
|
|
4. Run the cron.
|
2021-06-06 17:01:35 +00:00
|
|
|
```
|
2021-07-11 09:04:51 +00:00
|
|
|
go run ./cmd/cron/main.go
|
|
|
|
```
|
|
|
|
5. Run the data updater in a new tab.
|
|
|
|
```
|
|
|
|
go run ./cmd/dataupdater/main.go
|
2021-06-06 17:01:35 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
Distributed under the MIT License. See ``LICENSE`` for more information.
|
|
|
|
|
|
|
|
## Contact
|
|
|
|
|
|
|
|
Dawid Wysokiński - [contact@dwysokinski.me](mailto:contact@dwysokinski.me)
|