Skip to content

Commit b9ecd58

Browse files
authored
add log first activity (#3)
1 parent d4bbc5b commit b9ecd58

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/spark.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@ const sleep = dt => new Promise(resolve => setTimeout(resolve, dt))
44

55
// Create activity events when we bacome operational or fail, but only once
66
export class ActivityState {
7-
#ok = true
7+
#ok = null
88

99
onError () {
10-
if (this.#ok) {
10+
if (this.#ok === null || this.#ok) {
1111
this.#ok = false
1212
Zinnia.activity.error('SPARK failed reporting retrieval')
1313
}
1414
}
1515

1616
onSuccess () {
17-
if (!this.#ok) {
17+
if (this.#ok === null) {
18+
this.#ok = true
19+
Zinnia.activity.info('SPARK started reporting retrievals')
20+
} else if (!this.#ok) {
1821
this.#ok = true
1922
Zinnia.activity.info('SPARK retrieval reporting resumed')
2023
}

0 commit comments

Comments
 (0)