Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(node): Only set
DeviceContext.boot_time
if os.uptime()
is val…
…id (#5859) When creating the `DeviceContext` in the Node SDK `Context` integration, we calculate the boot time based on `os.uptime`. However, as reported in #5856, `os.uptime` might not always be available or return undefined (I couldn't figure out which of the two cases actually was responsible). This patch fixes this bug by simply not setting the boot time in case we don't get a valid up time. It also adds two basic tests for this behaviour. I opted to not set the boot time instead of e.g. defaulting to `0` for uptime because IMO this creates a false boot time that probably causes more confusion than not having it.
- Loading branch information