Skip to content

Use the lockfile package in the cache.#83

Merged
floitsch merged 1 commit into
mainfrom
floitsch/logger-ui.lockfile
Oct 29, 2025
Merged

Use the lockfile package in the cache.#83
floitsch merged 1 commit into
mainfrom
floitsch/logger-ui.lockfile

Conversation

@floitsch
Copy link
Copy Markdown
Member

No description provided.

@floitsch floitsch requested a review from kasperl September 21, 2025 17:02
@floitsch
Copy link
Copy Markdown
Member Author

Needs a release of the lockfile pkg (and a newer SDK version).

Copy link
Copy Markdown
Member

@kasperl kasperl left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Comment thread src/cache.toit
*/
get-file-path key/string -> string
--lock/lockfile.Lock?=null
[--on-stale-lock]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this be --if-stale-lock?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The on-stale-lock block is called whenever a stale lock is detected. It can remove the lock and let the lock continue. So this is really a callback.

Comment thread src/cache.toit
key-path := get-file-path key block
get key/string -> ByteArray
--lock/lockfile.Lock?=null
[--on-stale-lock]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

--if-stale-lock?

Comment thread src/cache.toit
// TODO(florian): add a `delete` method.
get-directory-path key/string -> string
--lock/lockfile.Lock?=null
[--on-stale-lock]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

--if-stale-lock

Copy link
Copy Markdown
Member

@kasperl kasperl left a comment

Choose a reason for hiding this comment

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

Makes sense!

Base automatically changed from floitsch/logger-ui to main October 29, 2025 14:47
@floitsch floitsch force-pushed the floitsch/logger-ui.lockfile branch from 57187ea to f6db7ca Compare October 29, 2025 16:08
@floitsch floitsch force-pushed the floitsch/logger-ui.lockfile branch from f6db7ca to ed291a2 Compare October 29, 2025 16:09
@floitsch floitsch enabled auto-merge (squash) October 29, 2025 16:10
@floitsch floitsch merged commit d3f79f8 into main Oct 29, 2025
7 checks passed
@floitsch floitsch deleted the floitsch/logger-ui.lockfile branch October 29, 2025 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants