-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send Customer.io notifications and warnings for connections being aut…
…o-disabled (#11670) * init commit to send notifications regarding connection auto-disabling * remove debugging prints * Add logic for warning about only failures for days * cleanup comments * remove deplicate code * refactor activity to be more readable * small cleanup * Refactor JobNotifier * fix formatting * Save state of last warning * Move last warning state to WorkflowInternalState * Reduce spam by getting timestamp info instead of saving state * edit tests * Fix formatting * cleanup checkIfWarningPreviouslySent * fix formatting * refactor for readability * Add extra comments * edit comments
- Loading branch information
1 parent
1e996c4
commit 9619f28
Showing
12 changed files
with
486 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
...scheduler/models/src/main/java/io/airbyte/scheduler/models/JobWithStatusAndTimestamp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Copyright (c) 2021 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.scheduler.models; | ||
|
||
import java.util.Objects; | ||
|
||
public class JobWithStatusAndTimestamp { | ||
|
||
private final long id; | ||
private final JobStatus status; | ||
private final long createdAtInSecond; | ||
private final long updatedAtInSecond; | ||
|
||
public JobWithStatusAndTimestamp(final long id, | ||
final JobStatus status, | ||
final long createdAtInSecond, | ||
final long updatedAtInSecond) { | ||
this.id = id; | ||
this.status = status; | ||
this.createdAtInSecond = createdAtInSecond; | ||
this.updatedAtInSecond = updatedAtInSecond; | ||
} | ||
|
||
public long getId() { | ||
return id; | ||
} | ||
|
||
public JobStatus getStatus() { | ||
return status; | ||
} | ||
|
||
public long getCreatedAtInSecond() { | ||
return createdAtInSecond; | ||
} | ||
|
||
public long getUpdatedAtInSecond() { | ||
return updatedAtInSecond; | ||
} | ||
|
||
@Override | ||
public boolean equals(final Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
final JobWithStatusAndTimestamp jobWithStatusAndTimestamp = (JobWithStatusAndTimestamp) o; | ||
return id == jobWithStatusAndTimestamp.id && | ||
status == jobWithStatusAndTimestamp.status && | ||
createdAtInSecond == jobWithStatusAndTimestamp.createdAtInSecond && | ||
updatedAtInSecond == jobWithStatusAndTimestamp.updatedAtInSecond; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(id, status, createdAtInSecond, updatedAtInSecond); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Job{" + | ||
"id=" + id + | ||
", status=" + status + | ||
", createdAtInSecond=" + createdAtInSecond + | ||
", updatedAtInSecond=" + updatedAtInSecond + | ||
'}'; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.