Skip to content

Commit 27486aa

Browse files
feat: only add workers that are enabled, separate config for job interval (#135)
* feat: only add workers that are enabled, seperate config for periodic job internval Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com> * config, mininterval Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com> * fix build Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com> --------- Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com>
1 parent a282029 commit 27486aa

File tree

10 files changed

+379
-139
lines changed

10 files changed

+379
-139
lines changed

config/.env.example

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,21 @@ RIVERBOAT_RIVER_WORKERS_DATABASEWORKER_CONFIG_ENABLED="true"
99
RIVERBOAT_RIVER_WORKERS_DATABASEWORKER_CONFIG_BASEURL="http://localhost:1337"
1010
RIVERBOAT_RIVER_WORKERS_DATABASEWORKER_CONFIG_ENDPOINT="query"
1111
RIVERBOAT_RIVER_WORKERS_DATABASEWORKER_CONFIG_DEBUG="false"
12+
RIVERBOAT_RIVER_WORKERS_CREATECUSTOMDOMAINWORKER_CONFIG_ENABLED=""
13+
RIVERBOAT_RIVER_WORKERS_CREATECUSTOMDOMAINWORKER_CONFIG_CLOUDFLAREAPIKEY=""
14+
RIVERBOAT_RIVER_WORKERS_CREATECUSTOMDOMAINWORKER_CONFIG_OPENLANEAPIHOST=""
15+
RIVERBOAT_RIVER_WORKERS_CREATECUSTOMDOMAINWORKER_CONFIG_OPENLANEAPITOKEN=""
16+
RIVERBOAT_RIVER_WORKERS_CREATECUSTOMDOMAINWORKER_CONFIG_DATABASEHOST=""
17+
RIVERBOAT_RIVER_WORKERS_DELETECUSTOMDOMAINWORKER_CONFIG_ENABLED=""
18+
RIVERBOAT_RIVER_WORKERS_DELETECUSTOMDOMAINWORKER_CONFIG_CLOUDFLAREAPIKEY=""
19+
RIVERBOAT_RIVER_WORKERS_DELETECUSTOMDOMAINWORKER_CONFIG_OPENLANEAPIHOST=""
20+
RIVERBOAT_RIVER_WORKERS_DELETECUSTOMDOMAINWORKER_CONFIG_OPENLANEAPITOKEN=""
21+
RIVERBOAT_RIVER_WORKERS_DELETECUSTOMDOMAINWORKER_CONFIG_DATABASEHOST=""
22+
RIVERBOAT_RIVER_WORKERS_EXPORTCONTENTWORKER_CONFIG_ENABLED=""
1223
RIVERBOAT_RIVER_WORKERS_EXPORTCONTENTWORKER_CONFIG_OPENLANEAPIHOST=""
1324
RIVERBOAT_RIVER_WORKERS_EXPORTCONTENTWORKER_CONFIG_OPENLANEAPITOKEN=""
25+
RIVERBOAT_RIVER_WORKERS_DELETEEXPORTCONTENTWORKER_CONFIG_ENABLED=""
26+
RIVERBOAT_RIVER_WORKERS_DELETEEXPORTCONTENTWORKER_CONFIG_INTERVAL=""
1427
RIVERBOAT_RIVER_WORKERS_DELETEEXPORTCONTENTWORKER_CONFIG_OPENLANEAPIHOST=""
1528
RIVERBOAT_RIVER_WORKERS_DELETEEXPORTCONTENTWORKER_CONFIG_OPENLANEAPITOKEN=""
1629
RIVERBOAT_RIVER_WORKERS_DELETEEXPORTCONTENTWORKER_CONFIG_CUTOFFDURATION=""

config/config.example.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ river:
44
queues: null
55
workers:
66
createCustomDomainWorker:
7-
Config:
7+
config:
88
cloudflareApiKey: ""
99
databaseHost: ""
10+
enabled: false
1011
openlaneAPIHost: ""
1112
openlaneAPIToken: ""
1213
databaseWorker:
@@ -16,14 +17,17 @@ river:
1617
enabled: true
1718
endpoint: query
1819
deleteCustomDomainWorker:
19-
Config:
20+
config:
2021
cloudflareApiKey: ""
2122
databaseHost: ""
23+
enabled: false
2224
openlaneAPIHost: ""
2325
openlaneAPIToken: ""
2426
deleteExportContentWorker:
2527
config:
2628
cutoffDuration: 0
29+
enabled: false
30+
interval: 0
2731
openlaneAPIHost: ""
2832
openlaneAPIToken: ""
2933
emailWorker:
@@ -34,11 +38,13 @@ river:
3438
token: ""
3539
exportContentWorker:
3640
config:
41+
enabled: false
3742
openlaneAPIHost: ""
3843
openlaneAPIToken: ""
3944
validateCustomDomainWorker:
4045
Config:
4146
cloudflareApiKey: ""
4247
databaseHost: ""
48+
enabled: false
4349
openlaneAPIHost: ""
4450
openlaneAPIToken: ""

config/configmap.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,21 @@ data:
2121
RIVERBOAT_RIVER_WORKERS_DATABASEWORKER_CONFIG_BASEURL: {{ .Values.riverboat.river.workers.databaseWorker.config.baseUrl | default "http://localhost:1337" }}
2222
RIVERBOAT_RIVER_WORKERS_DATABASEWORKER_CONFIG_ENDPOINT: {{ .Values.riverboat.river.workers.databaseWorker.config.endpoint | default "query" }}
2323
RIVERBOAT_RIVER_WORKERS_DATABASEWORKER_CONFIG_DEBUG: {{ .Values.riverboat.river.workers.databaseWorker.config.debug | default false }}
24+
RIVERBOAT_RIVER_WORKERS_CREATECUSTOMDOMAINWORKER_CONFIG_ENABLED: {{ .Values.riverboat.river.workers.createCustomDomainWorker.config.enabled }}
25+
RIVERBOAT_RIVER_WORKERS_CREATECUSTOMDOMAINWORKER_CONFIG_CLOUDFLAREAPIKEY: {{ .Values.riverboat.river.workers.createCustomDomainWorker.config.cloudflareApiKey }}
26+
RIVERBOAT_RIVER_WORKERS_CREATECUSTOMDOMAINWORKER_CONFIG_OPENLANEAPIHOST: {{ .Values.riverboat.river.workers.createCustomDomainWorker.config.openlaneAPIHost }}
27+
RIVERBOAT_RIVER_WORKERS_CREATECUSTOMDOMAINWORKER_CONFIG_OPENLANEAPITOKEN: {{ .Values.riverboat.river.workers.createCustomDomainWorker.config.openlaneAPIToken }}
28+
RIVERBOAT_RIVER_WORKERS_CREATECUSTOMDOMAINWORKER_CONFIG_DATABASEHOST: {{ .Values.riverboat.river.workers.createCustomDomainWorker.config.databaseHost }}
29+
RIVERBOAT_RIVER_WORKERS_DELETECUSTOMDOMAINWORKER_CONFIG_ENABLED: {{ .Values.riverboat.river.workers.deleteCustomDomainWorker.config.enabled }}
30+
RIVERBOAT_RIVER_WORKERS_DELETECUSTOMDOMAINWORKER_CONFIG_CLOUDFLAREAPIKEY: {{ .Values.riverboat.river.workers.deleteCustomDomainWorker.config.cloudflareApiKey }}
31+
RIVERBOAT_RIVER_WORKERS_DELETECUSTOMDOMAINWORKER_CONFIG_OPENLANEAPIHOST: {{ .Values.riverboat.river.workers.deleteCustomDomainWorker.config.openlaneAPIHost }}
32+
RIVERBOAT_RIVER_WORKERS_DELETECUSTOMDOMAINWORKER_CONFIG_OPENLANEAPITOKEN: {{ .Values.riverboat.river.workers.deleteCustomDomainWorker.config.openlaneAPIToken }}
33+
RIVERBOAT_RIVER_WORKERS_DELETECUSTOMDOMAINWORKER_CONFIG_DATABASEHOST: {{ .Values.riverboat.river.workers.deleteCustomDomainWorker.config.databaseHost }}
34+
RIVERBOAT_RIVER_WORKERS_EXPORTCONTENTWORKER_CONFIG_ENABLED: {{ .Values.riverboat.river.workers.exportContentWorker.config.enabled }}
2435
RIVERBOAT_RIVER_WORKERS_EXPORTCONTENTWORKER_CONFIG_OPENLANEAPIHOST: {{ .Values.riverboat.river.workers.exportContentWorker.config.openlaneAPIHost }}
2536
RIVERBOAT_RIVER_WORKERS_EXPORTCONTENTWORKER_CONFIG_OPENLANEAPITOKEN: {{ .Values.riverboat.river.workers.exportContentWorker.config.openlaneAPIToken }}
37+
RIVERBOAT_RIVER_WORKERS_DELETEEXPORTCONTENTWORKER_CONFIG_ENABLED: {{ .Values.riverboat.river.workers.deleteExportContentWorker.config.enabled }}
38+
RIVERBOAT_RIVER_WORKERS_DELETEEXPORTCONTENTWORKER_CONFIG_INTERVAL: {{ .Values.riverboat.river.workers.deleteExportContentWorker.config.interval }}
2639
RIVERBOAT_RIVER_WORKERS_DELETEEXPORTCONTENTWORKER_CONFIG_OPENLANEAPIHOST: {{ .Values.riverboat.river.workers.deleteExportContentWorker.config.openlaneAPIHost }}
2740
RIVERBOAT_RIVER_WORKERS_DELETEEXPORTCONTENTWORKER_CONFIG_OPENLANEAPITOKEN: {{ .Values.riverboat.river.workers.deleteExportContentWorker.config.openlaneAPIToken }}
2841
RIVERBOAT_RIVER_WORKERS_DELETEEXPORTCONTENTWORKER_CONFIG_CUTOFFDURATION: {{ .Values.riverboat.river.workers.deleteExportContentWorker.config.cutoffDuration }}

configgen/api-docs.md

Lines changed: 170 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,41 @@
88
|[**river**](#river)|`object`|Config is the configuration for the river server<br/>||
99

1010
**Additional Properties:** not allowed
11+
**Example**
12+
13+
```json
14+
{
15+
"river": {
16+
"queues": [
17+
{}
18+
],
19+
"workers": {
20+
"emailWorker": {
21+
"config": {}
22+
},
23+
"databaseWorker": {
24+
"config": {}
25+
},
26+
"createCustomDomainWorker": {
27+
"config": {}
28+
},
29+
"validateCustomDomainWorker": {
30+
"Config": {}
31+
},
32+
"deleteCustomDomainWorker": {
33+
"config": {}
34+
},
35+
"exportContentWorker": {
36+
"config": {}
37+
},
38+
"deleteExportContentWorker": {
39+
"config": {}
40+
}
41+
}
42+
}
43+
}
44+
```
45+
1146
<a name="river"></a>
1247
## river: object
1348

@@ -23,11 +58,52 @@ Config is the configuration for the river server
2358
|[**workers**](#riverworkers)|`object`|Workers that will be enabled on the server<br/>||
2459

2560
**Additional Properties:** not allowed
61+
**Example**
62+
63+
```json
64+
{
65+
"queues": [
66+
{}
67+
],
68+
"workers": {
69+
"emailWorker": {
70+
"config": {}
71+
},
72+
"databaseWorker": {
73+
"config": {}
74+
},
75+
"createCustomDomainWorker": {
76+
"config": {}
77+
},
78+
"validateCustomDomainWorker": {
79+
"Config": {}
80+
},
81+
"deleteCustomDomainWorker": {
82+
"config": {}
83+
},
84+
"exportContentWorker": {
85+
"config": {}
86+
},
87+
"deleteExportContentWorker": {
88+
"config": {}
89+
}
90+
}
91+
}
92+
```
93+
2694
<a name="riverqueues"></a>
2795
### river\.queues: array
2896

2997
**Items**
3098

99+
**Example**
100+
101+
```json
102+
[
103+
{}
104+
]
105+
```
106+
31107
<a name="riverworkers"></a>
32108
### river\.workers: object
33109

@@ -47,6 +123,34 @@ Workers that will be enabled on the server
47123
|[**deleteExportContentWorker**](#riverworkersdeleteexportcontentworker)|`object`|||
48124

49125
**Additional Properties:** not allowed
126+
**Example**
127+
128+
```json
129+
{
130+
"emailWorker": {
131+
"config": {}
132+
},
133+
"databaseWorker": {
134+
"config": {}
135+
},
136+
"createCustomDomainWorker": {
137+
"config": {}
138+
},
139+
"validateCustomDomainWorker": {
140+
"Config": {}
141+
},
142+
"deleteCustomDomainWorker": {
143+
"config": {}
144+
},
145+
"exportContentWorker": {
146+
"config": {}
147+
},
148+
"deleteExportContentWorker": {
149+
"config": {}
150+
}
151+
}
152+
```
153+
50154
<a name="riverworkersemailworker"></a>
51155
#### river\.workers\.emailWorker: object
52156

@@ -60,6 +164,14 @@ EmailWorker is a worker to send emails using the resend email provider the confi
60164
|[**config**](#riverworkersemailworkerconfig)|`object`|EmailConfig contains the configuration for the email worker<br/>||
61165

62166
**Additional Properties:** not allowed
167+
**Example**
168+
169+
```json
170+
{
171+
"config": {}
172+
}
173+
```
174+
63175
<a name="riverworkersemailworkerconfig"></a>
64176
##### river\.workers\.emailWorker\.config: object
65177

@@ -89,6 +201,14 @@ DatabaseWorker is a worker to create a dedicated database for an organization
89201
|[**config**](#riverworkersdatabaseworkerconfig)|`object`|||
90202

91203
**Additional Properties:** not allowed
204+
**Example**
205+
206+
```json
207+
{
208+
"config": {}
209+
}
210+
```
211+
92212
<a name="riverworkersdatabaseworkerconfig"></a>
93213
##### river\.workers\.databaseWorker\.config: object
94214

@@ -109,16 +229,25 @@ DatabaseWorker is a worker to create a dedicated database for an organization
109229

110230
|Name|Type|Description|Required|
111231
|----|----|-----------|--------|
112-
|[**Config**](#riverworkerscreatecustomdomainworkerconfig)|`object`|||
232+
|[**config**](#riverworkerscreatecustomdomainworkerconfig)|`object`|||
113233

114234
**Additional Properties:** not allowed
235+
**Example**
236+
237+
```json
238+
{
239+
"config": {}
240+
}
241+
```
242+
115243
<a name="riverworkerscreatecustomdomainworkerconfig"></a>
116-
##### river\.workers\.createCustomDomainWorker\.Config: object
244+
##### river\.workers\.createCustomDomainWorker\.config: object
117245

118246
**Properties**
119247

120248
|Name|Type|Description|Required|
121249
|----|----|-----------|--------|
250+
|**enabled**|`boolean`|||
122251
|**cloudflareApiKey**|`string`|||
123252
|**openlaneAPIHost**|`string`|||
124253
|**openlaneAPIToken**|`string`|||
@@ -135,13 +264,22 @@ DatabaseWorker is a worker to create a dedicated database for an organization
135264
|[**Config**](#riverworkersvalidatecustomdomainworkerconfig)|`object`|||
136265

137266
**Additional Properties:** not allowed
267+
**Example**
268+
269+
```json
270+
{
271+
"Config": {}
272+
}
273+
```
274+
138275
<a name="riverworkersvalidatecustomdomainworkerconfig"></a>
139276
##### river\.workers\.validateCustomDomainWorker\.Config: object
140277

141278
**Properties**
142279

143280
|Name|Type|Description|Required|
144281
|----|----|-----------|--------|
282+
|**enabled**|`boolean`|||
145283
|**cloudflareApiKey**|`string`|||
146284
|**openlaneAPIHost**|`string`|||
147285
|**openlaneAPIToken**|`string`|||
@@ -155,16 +293,25 @@ DatabaseWorker is a worker to create a dedicated database for an organization
155293

156294
|Name|Type|Description|Required|
157295
|----|----|-----------|--------|
158-
|[**Config**](#riverworkersdeletecustomdomainworkerconfig)|`object`|||
296+
|[**config**](#riverworkersdeletecustomdomainworkerconfig)|`object`|||
159297

160298
**Additional Properties:** not allowed
299+
**Example**
300+
301+
```json
302+
{
303+
"config": {}
304+
}
305+
```
306+
161307
<a name="riverworkersdeletecustomdomainworkerconfig"></a>
162-
##### river\.workers\.deleteCustomDomainWorker\.Config: object
308+
##### river\.workers\.deleteCustomDomainWorker\.config: object
163309

164310
**Properties**
165311

166312
|Name|Type|Description|Required|
167313
|----|----|-----------|--------|
314+
|**enabled**|`boolean`|||
168315
|**cloudflareApiKey**|`string`|||
169316
|**openlaneAPIHost**|`string`|||
170317
|**openlaneAPIToken**|`string`|||
@@ -181,13 +328,22 @@ DatabaseWorker is a worker to create a dedicated database for an organization
181328
|[**config**](#riverworkersexportcontentworkerconfig)|`object`|||
182329

183330
**Additional Properties:** not allowed
331+
**Example**
332+
333+
```json
334+
{
335+
"config": {}
336+
}
337+
```
338+
184339
<a name="riverworkersexportcontentworkerconfig"></a>
185340
##### river\.workers\.exportContentWorker\.config: object
186341

187342
**Properties**
188343

189344
|Name|Type|Description|Required|
190345
|----|----|-----------|--------|
346+
|**enabled**|`boolean`|||
191347
|**openlaneAPIHost**|`string`|||
192348
|**openlaneAPIToken**|`string`|||
193349

@@ -202,13 +358,23 @@ DatabaseWorker is a worker to create a dedicated database for an organization
202358
|[**config**](#riverworkersdeleteexportcontentworkerconfig)|`object`||yes|
203359

204360
**Additional Properties:** not allowed
361+
**Example**
362+
363+
```json
364+
{
365+
"config": {}
366+
}
367+
```
368+
205369
<a name="riverworkersdeleteexportcontentworkerconfig"></a>
206370
##### river\.workers\.deleteExportContentWorker\.config: object
207371

208372
**Properties**
209373

210374
|Name|Type|Description|Required|
211375
|----|----|-----------|--------|
376+
|**enabled**|`boolean`||no|
377+
|**interval**|`integer`||yes|
212378
|**openlaneAPIHost**|`string`||no|
213379
|**openlaneAPIToken**|`string`||no|
214380
|**cutoffDuration**|`integer`||yes|

0 commit comments

Comments
 (0)