mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-09-21 07:28:30 +03:00
ford: clear caches in response to memory pressure
This commit is contained in:
parent
515bfcd312
commit
8ff445c68c
@ -6171,10 +6171,27 @@
|
|||||||
::
|
::
|
||||||
:: %trim: in response to memory pressure
|
:: %trim: in response to memory pressure
|
||||||
::
|
::
|
||||||
:: XX clear cache
|
|
||||||
::
|
|
||||||
%trim
|
%trim
|
||||||
::
|
::
|
||||||
|
?. =(0 p.task)
|
||||||
|
:: low-priority: remove 50% of cache/stored-builds
|
||||||
|
::
|
||||||
|
~> %slog.[0 leaf+"ford: trim: pruning caches"]
|
||||||
|
=. state.ax (wipe:this-event 50)
|
||||||
|
[~ ford-gate]
|
||||||
|
::
|
||||||
|
:: high-priority: remove 100% of cache/stored-builds
|
||||||
|
::
|
||||||
|
:: We use %keep to ensure that cache-keys are also purged,
|
||||||
|
:: then restore original limits to allow future caching.
|
||||||
|
::
|
||||||
|
:: XX cancel in-progress builds?
|
||||||
|
::
|
||||||
|
~> %slog.[0 leaf+"ford: trim: clearing caches"]
|
||||||
|
=/ b-max max-size.queue.build-cache.state.ax
|
||||||
|
=/ c-max max-size.compiler-cache.state.ax
|
||||||
|
=. state.ax (keep:this-event 0 0)
|
||||||
|
=. state.ax (keep:this-event c-max b-max)
|
||||||
[~ ford-gate]
|
[~ ford-gate]
|
||||||
::
|
::
|
||||||
:: %vega: learn of kernel upgrade
|
:: %vega: learn of kernel upgrade
|
||||||
|
Loading…
Reference in New Issue
Block a user