Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Codersdk/ts: migrate workspace ttl to ttl_ms #1707

Closed as not planned
Closed as not planned
Labels
apiArea: HTTP APIstaleThis issue is like stale bread.
@johnstcn

Description

@johnstcn

TL;DR make allTTL references incodersdk be milliseconds instead of nanoseconds.

Initially when defining the external API for workspace time-to-live (TTL), I simply passed through the Golangtime.Duration object as anint64. This is ananosecond timestamp, which means that the typescript UI needs to multiply/divide any timestamps by 1 million.

This is a potential source of future time-bugs (the worst kind of bugs), so it would make sense to align the typescript API with what JS/TS generally uses for timestamps (milliseconds).

remark (non-blocking): in a follow-up PR, I think it could make sense to migrate `ttl` to `ttl_ms` in externally-facing API types so that we don't accidentally multiply by a million one way or another. Milliseconds seems to be the accepted unit of time in the TS/JS world.

Originally posted by@johnstcn in#1701 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiArea: HTTP APIstaleThis issue is like stale bread.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp