This repository has been archived on 2022-09-04. You can view files and clone it, but cannot push or open issues or pull requests.
dataupdater/README.md

59 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

# dataupdater
- 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.
## 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
```
DB_USER=your_db_user
DB_NAME=your_db_name
2020-06-01 19:05:33 +00:00
DB_PORT=5432
DB_HOST=your_db_host
DB_PASSWORD=your_db_pass
REDIS_ADDR=redis_addr
REDIS_DB=redis_db
REDIS_USER=redis_user
REDIS_PASSWORD=redis_password
RUN_ON_INIT=true|false
LOG_DB_QUERIES=true|false
WORKER_LIMIT=1
2020-06-01 19:05:33 +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.
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)