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

refact(event): refactor event manager #324

Merged
merged 2 commits into from
Jan 19, 2018

Conversation

supereagle
Copy link
Member

Fixes #302

Changes

  • refactor event manager to remove ETCD

@caicloud-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@caicloud-bot caicloud-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jan 18, 2018
@caicloud-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
We suggest the following additional approvers:

Assign the PR to them by writing /assign in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

store/event.go Outdated
intervalNum = retryThreshold
}

event.InTime = event.InTime.Add(time.Duration(time.Duration(intervalNum) * retryInterval))
Copy link
Contributor

@zoumo zoumo Jan 19, 2018

Choose a reason for hiding this comment

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

event.InTime = event.InTime.Add(intervalNum * retryInterval)
retryInterval is already a Duration.

Copy link
Member Author

Choose a reason for hiding this comment

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

Still need one conversion: event.InTime = event.InTime.Add(time.Duration(intervalNum) * retryInterval)
The outer conversion is not necessary.

store/event.go Outdated
// outTimeout represents the timeout for event to keep "out" status.
// After the event is out, then its status will be "handling" after it starts to be handled,
// otherwise, it will be re-enqueued and its status will change back to "in".
outTimeout, _ = time.ParseDuration("-3m")
Copy link
Contributor

@zoumo zoumo Jan 19, 2018

Choose a reason for hiding this comment

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

Is there any reason for you to use time.ParseDuration? It seems that you exactly know the timeout duration.
outTimeout = -3 * time.Minute

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Contributor

@zoumo zoumo left a comment

Choose a reason for hiding this comment

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

LGTM

@supereagle supereagle merged commit 02b735a into caicloud:v1-preview Jan 19, 2018
@supereagle supereagle deleted the event-refactor branch January 19, 2018 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants