Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consistent alerting #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

consistent alerting #19

wants to merge 1 commit into from

Conversation

steveklebanoff
Copy link
Collaborator

  • don't set block as alerted if it failed to run
  • check to see if already alerted on before alerting

Copy link
Collaborator

@marcusmolchany marcusmolchany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one comment for a cache key helper. this change is great

type: "discord" | "twitter",
txnHash: string
) => {
await setRedisAsync(`alerted:${type}:${txnHash.toLowerCase()}`, "true");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit but we could make something like:

const getAlertedCacheKey = (type: "discord" | "twitter", txHash: string): string =>
  `alerted:${type}:${txnHash.toLowerCase()}`;

and then this could be

Suggested change
await setRedisAsync(`alerted:${type}:${txnHash.toLowerCase()}`, "true");
const cacheKey = getAlertedCacheKey(type, txnHash);
await setRedisAsync(cacheKey, "true");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants