feat(schema): task.schema.json + project.tasks/jsGojaSyncPromise
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
1 parent
77c6891c6f
commit
c3106e7e1e
2 files changed
+111
No files matched your search
@@ -181,6 +181,20 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"tasks": {
|
||||
"description": "Benannte Arbeitseinheiten für context.enqueue (kein cron). Name im YAML, nicht der Dateiname.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"$ref": "task.schema.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"jobs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
@@ -420,6 +434,10 @@
|
||||
"goja",
|
||||
"v8"
|
||||
]
|
||||
},
|
||||
"jsGojaSyncPromise": {
|
||||
"description": "Legacy-Promise-Semantik von goja (synchron gepumpte Promises). Default true (P6a, verhaltensneutral); nach der Migration false für spec-konforme Promises wie V8. V8 ignoriert den Wert.",
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "task.schema.json",
|
||||
"title": "Tibi task config",
|
||||
"description": "Konfigurierte Arbeitseinheit für context.enqueue. Anders als ein Job hat ein Task kein cron-Feld: er wird ausschließlich per enqueue gestartet. Der Name steht im YAML und ist der stabile Vertrag, gegen den enqueue prüft.",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"patternProperties": {
|
||||
"^x-": {}
|
||||
},
|
||||
"properties": {
|
||||
"name": {
|
||||
"description": "Verbindlicher Task-Name (nicht der Dateiname). Eindeutig pro Projekt; eine Dublette ist ein Ladefehler.",
|
||||
"type": "string",
|
||||
"pattern": "^[a-z][a-z0-9._-]{0,63}$"
|
||||
},
|
||||
"type": {
|
||||
"const": "javascript"
|
||||
},
|
||||
"file": {
|
||||
"type": "string",
|
||||
"description": "Pfad relativ zum Projektverzeichnis (api/), wie bei Jobs."
|
||||
},
|
||||
"timeout": {
|
||||
"description": "Abbruch nach dieser Zeit. Akzeptiert Millisekunden (5000) oder eine Go-Duration (\"5s\", \"2m\").",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$"
|
||||
}
|
||||
]
|
||||
},
|
||||
"engine": {
|
||||
"description": "Überschreibt die Projekt-Engine für diesen Task.",
|
||||
"enum": [
|
||||
"",
|
||||
"goja",
|
||||
"v8"
|
||||
]
|
||||
},
|
||||
"concurrency": {
|
||||
"description": "Maximal gleichzeitig laufende Instanzen dieses Tasks (prozesslokal; der Server läuft pro Projekt singulär).",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 1
|
||||
},
|
||||
"retries": {
|
||||
"description": "Anzahl der Wiederholungen nach einem Fehler. 0 = keine Wiederholung.",
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"default": 0
|
||||
},
|
||||
"backoffBase": {
|
||||
"description": "Wartezeit vor dem ersten Retry (verdoppelt sich je Versuch).",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$"
|
||||
}
|
||||
]
|
||||
},
|
||||
"backoffMax": {
|
||||
"description": "Obergrenze der Backoff-Wartezeit.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$"
|
||||
}
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"file"
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user