-
-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: env variables for ACTION_HISTORY limits #1261
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -17,9 +17,9 @@ | |||||
// on rows and the maximum total number of bytes in the "body" column. | ||||||
// Pruning is done when the history has grown above these limits, to | ||||||
// the specified factor. | ||||||
const ACTION_HISTORY_MAX_ROWS = 1000; | ||||||
const ACTION_HISTORY_MAX_BYTES = 1000 * 1000 * 1000; // 1 GB. | ||||||
const ACTION_HISTORY_GRACE_FACTOR = 1.25; // allow growth to 1250 rows / 1.25 GB. | ||||||
const ACTION_HISTORY_MAX_ROWS = parseInt(process.env.ACTION_HISTORY_MAX_ROWS, 10) || 1000; | ||||||
Check failure on line 20 in app/server/lib/ActionHistoryImpl.ts GitHub Actions / build_and_test (3.11, 22.x, :server-2-of-2:)
Check failure on line 20 in app/server/lib/ActionHistoryImpl.ts GitHub Actions / build_and_test (3.11, 22.x, :nbrowser-^[O-R]:)
Check failure on line 20 in app/server/lib/ActionHistoryImpl.ts GitHub Actions / build_and_test (3.11, 22.x, :nbrowser-^[E-L]:)
Check failure on line 20 in app/server/lib/ActionHistoryImpl.ts GitHub Actions / build_and_test (3.11, 22.x, :nbrowser-^[^A-R]:)
Check failure on line 20 in app/server/lib/ActionHistoryImpl.ts GitHub Actions / build_and_test (3.11, 22.x, :nbrowser-^[M-N]:)
Check failure on line 20 in app/server/lib/ActionHistoryImpl.ts GitHub Actions / build_and_test (3.11, 22.x, :server-1-of-2:)
Check failure on line 20 in app/server/lib/ActionHistoryImpl.ts GitHub Actions / build_and_test (3.11, 22.x, :nbrowser-^[A-D]:)
Check failure on line 20 in app/server/lib/ActionHistoryImpl.ts GitHub Actions / build_and_test (:lint:python:client:common:smoke:, 22.x, 3.10)
|
||||||
const ACTION_HISTORY_MAX_BYTES = parseInt(process.env.ACTION_HISTORY_MAX_BYTES, 10) || 1000 * 1000 * 1000; // 1 GB. | ||||||
Check failure on line 21 in app/server/lib/ActionHistoryImpl.ts GitHub Actions / build_and_test (3.11, 22.x, :server-2-of-2:)
Check failure on line 21 in app/server/lib/ActionHistoryImpl.ts GitHub Actions / build_and_test (3.11, 22.x, :nbrowser-^[O-R]:)
Check failure on line 21 in app/server/lib/ActionHistoryImpl.ts GitHub Actions / build_and_test (3.11, 22.x, :nbrowser-^[E-L]:)
Check failure on line 21 in app/server/lib/ActionHistoryImpl.ts GitHub Actions / build_and_test (3.11, 22.x, :nbrowser-^[^A-R]:)
Check failure on line 21 in app/server/lib/ActionHistoryImpl.ts GitHub Actions / build_and_test (3.11, 22.x, :nbrowser-^[M-N]:)
Check failure on line 21 in app/server/lib/ActionHistoryImpl.ts GitHub Actions / build_and_test (3.11, 22.x, :server-1-of-2:)
Check failure on line 21 in app/server/lib/ActionHistoryImpl.ts GitHub Actions / build_and_test (3.11, 22.x, :nbrowser-^[A-D]:)
Check failure on line 21 in app/server/lib/ActionHistoryImpl.ts GitHub Actions / build_and_test (:lint:python:client:common:smoke:, 22.x, 3.10)
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same thing here
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both should work here, I feel like this should make no difference. |
||||||
const ACTION_HISTORY_GRACE_FACTOR = 1.25; // allow growth to 1.25 times the above limits. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we want to give access to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like:
Also YAGNI, so I would leave it as is and let a user either report the need or make a contribution if they really need to |
||||||
const ACTION_HISTORY_CHECK_PERIOD = 10; // number of actions between size checks. | ||||||
|
||||||
/** | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the Typescript to do what you want is
If what you set in
env
isNaN
, let say"test"
it will fallback to default value 1000.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but @fflorent suggestion is better.