Skip to content

Commit

Permalink
fix: job rate limit (#409)
Browse files Browse the repository at this point in the history
Signed-off-by: zhaoxinxin <[email protected]>
  • Loading branch information
Liam-Zhao authored Nov 11, 2024
1 parent 3b99678 commit dded1e4
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/clusters/update-cluster.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ describe('Update cluster', () => {
cy.get('#peerLoadLimit').should('have.value', 0);
cy.get('#candidateParentLimit').should('have.value', 0);
cy.get('#filterParentLimit').should('have.value', 0);
cy.get('#jobRateLimit').should('have.value', 0);
cy.get('#jobRateLimit').should('have.value', 10);
});

it('can update cluster', () => {
Expand Down
4 changes: 2 additions & 2 deletions public/icons/cluster/selected-cluster.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions public/icons/insight/selected-insight.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions public/icons/job/preheat/selected-job.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/icons/tokens/selected-developer.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/icons/user/selected-user.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions src/components/clusters/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ export default function EditCluster() {
scheduler_cluster_config: {
candidate_parent_limit: 0,
filter_parent_limit: 0,
job_rate_limit: 0,
job_rate_limit: 10,
},
seed_peer_cluster_config: {
load_limit: 0,
load_limit: 2000,
},
peer_cluster_config: {
load_limit: 0,
load_limit: 200,
},
created_at: '',
updated_at: '',
Expand Down Expand Up @@ -529,7 +529,7 @@ export default function EditCluster() {
type: 'number',
autoComplete: 'family-name',
placeholder: 'Please enter Job Rate Limit',
value: job_rate_limit,
value: job_rate_limit || 10,
helperText: jobRateLimitError ? 'Fill in the number, the length is 1-1000000.' : '',
error: jobRateLimitError,

Expand All @@ -547,7 +547,7 @@ export default function EditCluster() {
InputProps: {
endAdornment: (
<Tooltip
title={`The scheduler will randomly select the number of parents from all the parents according to the filter parent limit and evaluate the optimal parents in selecting parents for the peer to download task. The number of optimal parent is the scheduling parent limit.`}
title={`The rate limit(requests per second) for job Open API, default value is 10.`}
placement="top"
>
<HelpIcon color="disabled" className={styles.descriptionIcon} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/clusters/information.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ export default function Information(props: { cluster: getClusterResponse; isLoad
</Box>
) : (
<Typography id="filter-parent-limit" component="div">
{cluster?.scheduler_cluster_config?.job_rate_limit || 0}
{cluster?.scheduler_cluster_config?.job_rate_limit || 10}
</Typography>
)}
</Box>
Expand Down
12 changes: 6 additions & 6 deletions src/components/menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,11 @@ export default function Layout(props: any) {
sx={{
'&.Mui-selected': {
backgroundColor: 'var(--menu-background-color)',
color: 'var(--menu-color)',
color: 'var(--description-color)',
},
'&.Mui-selected:hover': {
backgroundColor: 'var(--hover-menu-background-color)',
color: 'var(--menu-color)',
color: 'var(--description-color)',
},
height: '2.6rem',
borderRadius: '0.2rem',
Expand All @@ -304,11 +304,11 @@ export default function Layout(props: any) {
sx={{
'&.Mui-selected': {
backgroundColor: '#fff',
color: 'var(--menu-color)',
color: 'var(--description-color)',
},
'&.Mui-selected:hover': {
backgroundColor: '#fff',
color: 'var(--menu-color)',
color: 'var(--description-color)',
},
height: '2.4rem',
borderRadius: '0.2rem',
Expand All @@ -335,11 +335,11 @@ export default function Layout(props: any) {
sx={{
'&.Mui-selected': {
backgroundColor: 'var(--menu-background-color)',
color: 'var(--menu-color)',
color: 'var(--description-color)',
},
'&.Mui-selected:hover': {
backgroundColor: 'var(--hover-menu-background-color)',
color: 'var(--menu-color)',
color: 'var(--description-color)',
},
height: '2.6rem',
borderRadius: '0.2rem',
Expand Down

0 comments on commit dded1e4

Please sign in to comment.