-
Notifications
You must be signed in to change notification settings - Fork 44
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
feat: add filter for actor changes #1195
Conversation
tasks/actorstate/task.go
Outdated
const defaultActorChangeLimit = 10000 | ||
|
||
// Skip task processing when actor state changes abnormally. | ||
func (t *Task) exceedActorChangeLimit(changes map[address.Address]tasks.ActorStateChange) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: exceedsActorChangeLimit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
.gitignore
Outdated
@@ -21,3 +21,5 @@ visor | |||
build/.* | |||
support/tools/bin | |||
|
|||
# Deployment | |||
deployment/.env |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deployment/.env | |
.env |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will put the .env
file in the deployment folder because of docker-compose usage, therefore we should add the gitignore
here 😄 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I change it to *.env
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simply doing .env
would ignore it in all paths instead of *.env
which would only ignore in the root path. If we do hyperspecific paths like so, we could face the same problem again where the secrets are revealed.
tasks/actorstate/task.go
Outdated
limit := defaultActorChangeLimit | ||
|
||
// Access the custom threshold set in the environment variable | ||
s := os.Getenv(actorChangeLimiterEnv) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s := os.Getenv(actorChangeLimiterEnv) | |
s := os.Getenv(actorChangeLimiterEnv) |
os.LookupEnv might be nicer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*.env
will not match paths that
This feature can help prevent this issue from occurring again.
By modifying the environment variable:
LILY_ACTOR_CHANGE_LIMITER
, it is able to adjust the threshold.