Skip to content

Commit

Permalink
Add note about not re-registering the same block
Browse files Browse the repository at this point in the history
  • Loading branch information
ivoanjo committed Aug 7, 2024
1 parent 9f1d53d commit 216bc8b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/datadog/core/utils/at_fork_monkey_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def fork
result
end

# NOTE: You probably want to wrap any calls to datadog_at_fork with a OnlyOnce so as to not re-register
# the same block/behavior more than once.
def datadog_at_fork(stage, &block)
raise ArgumentError, 'Bad \'stage\' for ::datadog_at_fork' unless stage == :child

Expand Down

0 comments on commit 216bc8b

Please sign in to comment.