getsentry / getsentry/sentry-ruby

Cleanup initialize/close behavior to prevent initialized? checks everywhere

Ouverte
#2,096 1 commentaire 0 réactions 1 personne assignée Assignée à @st0012 Voir sur GitHub
Refactoring Ruby Task
Langage dominant
Ruby
Étoiles
987
Forks
541
Merge moyen
17 h 40 min
PR mergées (30 j)
19

Description

And perhaps we should implement a better version of `close` and `Sentry.initialize?` 🤔

Specifically:

- We don't erase hub variables, `@background_worker` and `@session_flusher`
- `Sentry.initialize?` is backed by a simple boolean state that's changed by `Sentry.ini` and `Sentry.close`.

We would still need `Sentry.initialize?` in some places to stop some actions after the SDK is closed, but we don't need it for preventing`nil` value anymore, which is getting out of hand IMO.

_Originally posted by @st0012 in https://github.com/getsentry/sentry-ruby/pull/2084#discussion_r1308034537_

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.