Skip to content

Commit

Permalink
Clarify Init errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ssoroka authored Jun 2, 2021
1 parent db0b6de commit dfed0e8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/developers/REVIEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ So in case you expect a longer period of inactivity or you want to abandon a pul
```
(in tests, you can do `myPlugin.Log = testutil.Logger{}`)
- Initialization and config checking should be done on the `Init() error` function, not in the Connect, Gather, or Start functions.
- `Init() error` should not contain connections to external services. If anything fails in Init, Telegraf will consider it a configuration error and refuse to start.
- plugins should avoid synchronization code if they are not starting goroutines. Plugin functions are never called in parallel.
- avoid goroutines when you don't need them and removing them would simplify the code
- errors should almost always be checked.
Expand Down

0 comments on commit dfed0e8

Please sign in to comment.