Closed lgarczyn closed 7 months ago
In this snippet:
private Heartbeat CreateHeartbeat(string entity) { string workingDir = Path.GetDirectoryName(entity); Heartbeat heartbeat = new Heartbeat { Entity = entity, EntityType = EntityTypes.File, Timestamp = DateTime.Now.ToUnixTimeFloat().ToString(), Project = Settings.ProjectName, BranchName = GitClient?.GetBranchName(workingDir), IsWrite = false, Category = Application.isPlaying ? HeartbeatCategories.Debugging : HeartbeatCategories.Coding, }; return heartbeat; }
DateTime.Now.ToUnixTimeFloat().ToString() should be Timestamp = DateTime.Now.ToUnixTimeFloat().ToString(CultureInfo.InvariantCulture),
DateTime.Now.ToUnixTimeFloat().ToString()
Timestamp = DateTime.Now.ToUnixTimeFloat().ToString(CultureInfo.InvariantCulture),
Otherwise if the current culture uses comma as a number seperator, you get errors such as:
Error: invalid argument "1,702235E+09" for "--time" flag: strconv.ParseFloat: parsing "1,702235E+09": invalid syntax
Thanks for the effort, I have merged your pull request.
In this snippet:
DateTime.Now.ToUnixTimeFloat().ToString()
should beTimestamp = DateTime.Now.ToUnixTimeFloat().ToString(CultureInfo.InvariantCulture),
Otherwise if the current culture uses comma as a number seperator, you get errors such as:
Error: invalid argument "1,702235E+09" for "--time" flag: strconv.ParseFloat: parsing "1,702235E+09": invalid syntax