Provide typed tasks.
This commit is contained in:
parent
3f46617f80
commit
d0539687bb
7 changed files with 133 additions and 104 deletions
|
|
@ -57,6 +57,7 @@ type (
|
|||
App AppConfig
|
||||
Cache CacheConfig
|
||||
Database DatabaseConfig
|
||||
Tasks TasksConfig
|
||||
Mail MailConfig
|
||||
}
|
||||
|
||||
|
|
@ -103,6 +104,16 @@ type (
|
|||
TestConnection string
|
||||
}
|
||||
|
||||
// TasksConfig stores the tasks configuration
|
||||
TasksConfig struct {
|
||||
Driver string
|
||||
Connection string
|
||||
TestConnection string
|
||||
PollInterval time.Duration
|
||||
MaxRetries int
|
||||
Goroutines int
|
||||
}
|
||||
|
||||
// MailConfig stores the mail configuration
|
||||
MailConfig struct {
|
||||
Hostname string
|
||||
|
|
|
|||
|
|
@ -31,6 +31,14 @@ database:
|
|||
connection: "dbs/main.db?_journal=WAL&_timeout=5000&_fk=true"
|
||||
testConnection: ":memory:?_journal=WAL&_timeout=5000&_fk=true"
|
||||
|
||||
tasks:
|
||||
driver: "sqlite3"
|
||||
connection: "dbs/jobs.db?_journal=WAL&_timeout=5000&_fk=true"
|
||||
testConnection: ":memory:?_journal=WAL&_timeout=5000&_fk=true"
|
||||
pollInterval: "1s"
|
||||
maxRetries: 10
|
||||
goRoutines: 1
|
||||
|
||||
mail:
|
||||
hostname: "localhost"
|
||||
port: 25
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue