Skip to content

Commit

Permalink
feat(github-eventsource): Support multi repos and mitigate race condi…
Browse files Browse the repository at this point in the history
…tions (#1181)

* feat(github-eventsource): Support multi repos and mitigate race conditions

Signed-off-by: Derek Wang <whynowy@gmail.com>
  • Loading branch information
whynowy committed May 4, 2021
1 parent 69c36cd commit ebc1fac
Show file tree
Hide file tree
Showing 22 changed files with 1,172 additions and 571 deletions.
63 changes: 60 additions & 3 deletions api/event-source.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 62 additions & 3 deletions api/event-source.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 26 additions & 3 deletions api/openapi-spec/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions docs/eventsources/webhook-health-check.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
# Webhook Health Check

![GA](../assets/ga.svg)

> v1.0 and after
For `webhook` or `webhook` extended event sources such as `github`, `gitlab`,
`sns`, `slack`, `Storage GRID` and `stripe`, besides the endpoint configured in
the spec, an extra endpoint `:${port}/health` will also be created, this is
useful for LB or Ingress configuration for the event source, where usually a
health check endpoint is required.

For example, the following EventSource object will have 4 endpoints created,
`:12000/example1`, `:12000/health`, `:13000/example2` and `:13000/health`. A
`:12000/example1`, `:12000/health`, `:13000/example2` and `:13000/health`. An
HTTP GET request to the health endpoint returns a text `OK` with HTTP response
code `200`.

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/01-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ to any type of event-source.
[instruction](https://github.com/argoproj/argo-events/tree/master/examples) to
create a Service Account `operate-workflow-sa` with proper privileges, and
make sure the Service Account used by Workflows (here we use `default` in the
turorials for demostration purpose) has proper RBAC settings.
turorials for demonstration purpose) has proper RBAC settings.

## Get Started

Expand Down
1 change: 1 addition & 0 deletions eventbus/driver/nats.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ func (n *natsStreaming) SubscribeEventSources(ctx context.Context, conn Connecti
defer wg.Done()
log.Info("starting ExactOnce cache clean up daemon ...")
ticker := time.NewTicker(60 * time.Second)
defer ticker.Stop()
for {
select {
case <-cacheEvictorStopCh:
Expand Down
1 change: 1 addition & 0 deletions eventsources/eventing.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ func (e *EventSourceAdaptor) run(ctx context.Context, servers map[apicommon.Even
defer connWG.Done()
logger.Info("starting eventbus connection daemon...")
ticker := time.NewTicker(5 * time.Second)
defer ticker.Stop()
for {
select {
case <-cctx.Done():
Expand Down
1 change: 1 addition & 0 deletions eventsources/sources/generic/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func (el *EventListener) StartListening(ctx context.Context, dispatch func([]byt

logger.Info("connecting to eventsource server in 5 seconds...")
ticker := time.NewTicker(5 * time.Second)
defer ticker.Stop()
for {
select {
case <-ctx.Done():
Expand Down
Loading

0 comments on commit ebc1fac

Please sign in to comment.