Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Conversation

@mattjohnsonpint
Copy link
Contributor

  • Split the time zone cache into two parts, and used Go's built-in time.LoadLocation for the common path
  • Added some logging in case we get any more errors in this area

@mattjohnsonpint mattjohnsonpint requested review from a team and Copilot June 24, 2025 02:06
@linear
Copy link

linear bot commented Jun 24, 2025

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors time zone loading into separate data and location caches, leverages Go’s built-in time.LoadLocation, and adds improved error handling and logging.

  • Split tzCache into tzDataCache and tzLocationCache and updated loading functions to return raw bytes or *time.Location.
  • Changed public APIs (GetLocation, GetTimeZoneData) to accept context.Context, return errors, and log failures.
  • Added checks for empty time zone data and unsupported formats, and updated the changelog.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
runtime/timezones/tzdata_windows.go Renamed loadTimeZoneInfoloadTimeZoneData, added empty-data check
runtime/timezones/tzdata_other.go Same refactor for non-Windows path, but missing imports and unused ones
runtime/timezones/timezones.go Introduced separate caches, context support, and error returns
runtime/hostfunctions/system.go Added context-aware logging and error handling in time helpers
CHANGELOG.md Bumped version and noted this fix
Comments suppressed due to low confidence (3)

runtime/timezones/tzdata_other.go:19

  • This file uses fmt.Errorf and errors.New but neither "fmt" nor "errors" are imported, causing build failures. Add the missing imports.
	"strings"

runtime/timezones/tzdata_other.go:18

  • [nitpick] The imports "path" and "strings" are not used in this function. Remove these unused imports to clean up the code.
	"path"

runtime/timezones/timezones.go:16

  • [nitpick] The "os" import is not used in this file; you can remove it to avoid unused-import warnings.
	"os"

@mattjohnsonpint mattjohnsonpint enabled auto-merge (squash) June 24, 2025 02:08
@mattjohnsonpint mattjohnsonpint merged commit 1a99c65 into main Jun 24, 2025
33 checks passed
@mattjohnsonpint mattjohnsonpint deleted the mjp/hyp-3520-failed-to-get-time-in-timezone branch June 24, 2025 02:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants