Skip to content
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

load balancer! #3230

Merged
merged 65 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
b1836ed
start of load balancer
jakeprobst Jun 10, 2024
5bb8959
add configuration options; option to load balance per deck
jakeprobst Jun 11, 2024
ac12e13
formatting
jakeprobst Jun 11, 2024
9c96fe5
clippy
jakeprobst Jun 11, 2024
25a8549
add myself to contributors
jakeprobst Jun 11, 2024
cd5e0df
cleanup
jakeprobst Jun 11, 2024
9595f6c
cargo fmt
jakeprobst Jun 11, 2024
63fa18b
copyright header on load_balancer.rs
jakeprobst Jun 11, 2024
a2bad0a
remove extra space
jakeprobst Jun 11, 2024
d53e248
more formatting
jakeprobst Jun 11, 2024
be92048
python formatting
jakeprobst Jun 11, 2024
8e28b71
ignore this being None
jakeprobst Jun 11, 2024
370eef6
only calculate notes on each day if we are trying to avoid siblings
jakeprobst Jun 13, 2024
cc3e991
don't fuzz intervals if the load balancer is enabled
jakeprobst Jun 13, 2024
98b3e79
force generator to eval so this actually happens
jakeprobst Jun 14, 2024
4972ef0
load balance instead of fuzzing, rather than in addition to
jakeprobst Jun 14, 2024
672021d
use builtin fuzz_bounds rather than reinvent something new
jakeprobst Jun 14, 2024
901bec7
print some debug info on how its load balancing
jakeprobst Jun 14, 2024
d16d4e3
clippy
jakeprobst Jun 14, 2024
e3a2d85
more accurately load balance only when we want to fuzz
jakeprobst Jun 14, 2024
7ff398a
incorrectly doublechecking the presence of the load balancer
jakeprobst Jun 14, 2024
47feb8e
more printfs for debugging
jakeprobst Jun 14, 2024
e80f90d
avoid siblings -> disperse siblings
jakeprobst Jun 14, 2024
ec6e9c0
load balance learning graduating intervals
jakeprobst Jun 25, 2024
a539954
load balancer: respect min/max intervals; graduating easy should be a…
jakeprobst Jun 27, 2024
b02cf01
filter out after-days under minimum interval
jakeprobst Jun 27, 2024
31691ed
this is an inclusive check
jakeprobst Jun 27, 2024
54521fb
switch load balancer to caching instead of on the fly calculation
jakeprobst Jul 12, 2024
267e255
Merge branch 'main' into load_balancer
jakeprobst Jul 12, 2024
7a6b42c
handle case where load balancer would balance outside of its bounds
jakeprobst Jul 12, 2024
8b93c39
disable lb when unselecting it in preferences
jakeprobst Jul 12, 2024
f3fd530
call load_balancer in StateContext::with_review_fuzz instead of next to
jakeprobst Jul 12, 2024
daeb154
rebuild load balancer when card queue is rebuilt
jakeprobst Jul 13, 2024
f9a0073
remove now-unused configuration options
jakeprobst Jul 13, 2024
17569e7
add note option to notetype to enable/disable sibling dispersion
jakeprobst Jul 13, 2024
d52afcd
add options to exclude decks from load balancing
jakeprobst Jul 14, 2024
de017e1
theres a lint checking that the link actually exists so I guess I'll …
jakeprobst Jul 14, 2024
033d757
Merge branch 'main' into load_balancer
jakeprobst Jul 22, 2024
4081f22
how did I even update this
jakeprobst Jul 22, 2024
291d8d1
move load balancer to cardqueue
jakeprobst Jul 23, 2024
7441395
remove per-deck balancing options
jakeprobst Jul 24, 2024
3395349
improve determining whether to disperse siblings when load balancing
jakeprobst Jul 24, 2024
580ea5e
don't recalculate notes on days every time
jakeprobst Jul 24, 2024
4ae66ae
Merge branch 'main' into load_balancer
dae Aug 5, 2024
ed97e8d
remove debug code
jakeprobst Aug 5, 2024
aff9087
remove all configuration; load balancer enabled by default; disperse …
jakeprobst Aug 5, 2024
6b8d9f8
didn't fully remove caring about decks from load balancer sql query
jakeprobst Aug 5, 2024
50e99fe
load balancer should only count cards in the same preset
jakeprobst Aug 5, 2024
0281aff
fuzz interval if its outside of load balancer's range
jakeprobst Aug 5, 2024
6a2b5b9
also check minimum when bailing out of load balancer
jakeprobst Aug 5, 2024
b7d0e59
cleanup; make tests happy
jakeprobst Aug 5, 2024
a3104ba
experimental weight-based load balance fuzzing
jakeprobst Aug 8, 2024
b4207e2
take into account interval when weighting as it seems to help
jakeprobst Aug 10, 2024
bcd56a1
if theres no cards the interval weight is just 1.0
jakeprobst Aug 13, 2024
72f9b69
make load balancer disableable through debug console
jakeprobst Aug 14, 2024
73f38d4
remove debug prints
jakeprobst Aug 14, 2024
bcfcfc9
typo
jakeprobst Aug 14, 2024
1d8882a
remove debugging print
jakeprobst Aug 17, 2024
f98210f
explain a bit how load balancer works
jakeprobst Aug 17, 2024
ad6d242
properly balance per preset
jakeprobst Aug 17, 2024
af45ea3
use inclusive range rather than +1
jakeprobst Aug 17, 2024
9e13e10
Merge remote-tracking branch 'upstream/main' into load_balancer
jakeprobst Aug 17, 2024
2742d75
-1 type cast
jakeprobst Aug 17, 2024
32840e1
move type hint somewhere less ugly; fix comment typo
jakeprobst Aug 17, 2024
edbe52c
Reuse existing deck list from parent function
dae Aug 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ Alexander Bocken <alexander@bocken.org>
James Elmore <email@jameselmore.org>
David Culley <6276049+davidculley@users.noreply.github.com>
Rastislav Kish <rastislav.kish@protonmail.com>
jake <jake@sharnoth.com>

********************

Expand Down
2 changes: 1 addition & 1 deletion ftl/core-repo
Submodule core-repo updated 81 files
+0 −1 core/ar/card-templates.ftl
+0 −1 core/ca/card-templates.ftl
+1 −4 core/ca/deck-config.ftl
+0 −6 core/ca/importing.ftl
+1 −1 core/ca/scheduling.ftl
+0 −1 core/cs/card-templates.ftl
+11 −17 core/cs/deck-config.ftl
+0 −16 core/el/deck-config.ftl
+0 −1 core/el/importing.ftl
+0 −5 core/el/preferences.ftl
+0 −1 core/el/scheduling.ftl
+5 −23 core/es/deck-config.ftl
+1 −0 core/es/scheduling.ftl
+0 −1 core/fi/card-templates.ftl
+0 −1 core/fr/card-templates.ftl
+9 −28 core/fr/deck-config.ftl
+0 −1 core/fr/importing.ftl
+0 −1 core/fr/preferences.ftl
+0 −7 core/fr/sync.ftl
+0 −1 core/it/card-templates.ftl
+18 −37 core/it/deck-config.ftl
+0 −1 core/it/importing.ftl
+0 −3 core/it/preferences.ftl
+0 −7 core/it/sync.ftl
+1 −1 core/ja/actions.ftl
+6 −6 core/ja/browsing.ftl
+11 −20 core/ja/deck-config.ftl
+2 −2 core/ja/decks.ftl
+5 −5 core/ja/editing.ftl
+2 −2 core/ja/errors.ftl
+2 −2 core/ja/importing.ftl
+2 −3 core/ja/studying.ftl
+1 −1 core/ja/sync.ftl
+0 −7 core/mr/actions.ftl
+0 −1 core/pl/card-templates.ftl
+0 −2 core/pl/deck-config.ftl
+0 −7 core/pl/importing.ftl
+0 −3 core/pl/preferences.ftl
+0 −7 core/pl/sync.ftl
+0 −1 core/ru/exporting.ftl
+8 −14 core/templates/deck-config.ftl
+0 −2 core/tr/adding.ftl
+0 −3 core/tr/card-template-rendering.ftl
+1 −1 core/tr/card-templates.ftl
+0 −76 core/ug/actions.ftl
+0 −12 core/ug/adding.ftl
+0 −179 core/ug/browsing.ftl
+0 −35 core/ug/card-stats.ftl
+0 −32 core/ug/card-template-rendering.ftl
+0 −63 core/ug/card-templates.ftl
+0 −13 core/ug/change-notetype.ftl
+0 −34 core/ug/custom-study.ftl
+0 −63 core/ug/database-check.ftl
+0 −233 core/ug/deck-config.ftl
+0 −39 core/ug/decks.ftl
+0 −102 core/ug/editing.ftl
+0 −14 core/ug/empty-cards.ftl
+0 −19 core/ug/errors.ftl
+0 −44 core/ug/exporting.ftl
+0 −23 core/ug/fields.ftl
+0 −5 core/ug/findreplace.ftl
+0 −13 core/ug/help.ftl
+0 −187 core/ug/importing.ftl
+0 −2 core/ug/keyboard.ftl
+0 −77 core/ug/media-check.ftl
+0 −7 core/ug/media.ftl
+0 −5 core/ug/network.ftl
+0 −57 core/ug/notetypes.ftl
+0 −83 core/ug/preferences.ftl
+0 −18 core/ug/profiles.ftl
+0 −166 core/ug/scheduling.ftl
+0 −29 core/ug/search.ftl
+0 −253 core/ug/statistics.ftl
+0 −60 core/ug/studying.ftl
+0 −43 core/ug/sync.ftl
+0 −11 core/ug/undo.ftl
+12 −18 core/uk/deck-config.ftl
+2 −2 core/uk/notetypes.ftl
+0 −1 core/zh-CN/card-templates.ftl
+4 −9 core/zh-CN/deck-config.ftl
+3 −4 core/zh-TW/deck-config.ftl
7 changes: 7 additions & 0 deletions ftl/core/deck-config.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,13 @@ deck-config-answer-good = Answer Good
deck-config-days-to-simulate = Days to simulate
deck-config-desired-retention-below-optimal = Your desired retention is below optimal. Increasing it is recommended.

# Load Balancer
deck-config-load-balancer-title = Load Balancer
deck-config-load-balancer-only-count-self = Only count self
deck-config-load-balancer-only-count-self-tooltip = Cards in this deck only count other cards in this deck when load balancing
deck-config-load-balancer-hide-from-others = Hide from other decks
deck-config-load-balancer-hide-from-others-tooltip = Cards in this deck do not count when load balancing other decks.

## NO NEED TO TRANSLATE. This text is no longer used by Anki, and will be removed in the future.

deck-config-bury-siblings = Bury siblings
Expand Down
1 change: 1 addition & 0 deletions ftl/core/notetypes.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ notetypes-note-types = Note Types
notetypes-options = Options
notetypes-please-add-another-note-type-first = Please add another note type first.
notetypes-type = Type
notetypes-load-balancer-disperse-siblings = Prevent sibling overlap when using Load Balancer

## Image Occlusion

Expand Down
2 changes: 2 additions & 0 deletions ftl/core/preferences.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ preferences-network-timeout = Network timeout
preferences-reset-window-sizes = Reset Window Sizes
preferences-reset-window-sizes-complete = Window sizes and locations have been reset.
preferences-shortcut-placeholder = Enter an unused shortcut key, or leave empty to disable.
preferences-load-balancer = Load Balancer
preferences-load-balancer-enable = Enable Load Balancer

## NO NEED TO TRANSLATE. This text is no longer used by Anki, and will be removed in the future.

Expand Down
2 changes: 2 additions & 0 deletions proto/anki/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ message ConfigKey {
RANDOM_ORDER_REPOSITION = 23;
SHIFT_POSITION_OF_EXISTING_CARDS = 24;
RENDER_LATEX = 25;
LOAD_BALANCER_ENABLE = 26;
}
enum String {
SET_DUE_BROWSER = 0;
Expand Down Expand Up @@ -115,6 +116,7 @@ message Preferences {
bool show_remaining_due_counts = 3;
bool show_intervals_on_buttons = 4;
uint32 time_limit_secs = 5;
bool load_balancer_enable = 6;
}
message Editing {
bool adding_defaults_to_current_deck = 1;
Expand Down
3 changes: 3 additions & 0 deletions proto/anki/deck_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ message DeckConfig {
float historical_retention = 40;
string weight_search = 45;

bool load_balancer_only_count_self = 47;
bool load_balancer_hide_from_others = 48;

bytes other = 255;
}

Expand Down
2 changes: 2 additions & 0 deletions proto/anki/notetypes.proto
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ message Notetype {
// the id in the source collection for imported notetypes (Anki 23.10)
optional int64 original_id = 10;

bool load_balancer_disperse_siblings = 11;

bytes other = 255;
}
message Field {
Expand Down
33 changes: 33 additions & 0 deletions qt/aqt/forms/modelopts.ui
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,39 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>preferences_load_balancer</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="disperseSiblings">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>notetypes_load_balancer_disperse_siblings</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
<item>
Expand Down
16 changes: 16 additions & 0 deletions qt/aqt/forms/preferences.ui
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,22 @@
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>preferences_load_balancer</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<widget class="QCheckBox" name="load_balancer_enable">
<property name="text">
<string>preferences_load_balancer_enable</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_12">
<property name="orientation">
Expand Down
2 changes: 2 additions & 0 deletions qt/aqt/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def onAdvanced(self) -> None:
frm.latexsvg.setChecked(nt.get("latexsvg", False))
frm.latexHeader.setText(nt["latexPre"])
frm.latexFooter.setText(nt["latexPost"])
frm.disperseSiblings.setChecked(nt.get("loadBalancerDisperseSiblings", True))
d.setWindowTitle(
without_unicode_isolation(tr.actions_options_for(val=nt["name"]))
)
Expand All @@ -203,6 +204,7 @@ def onAdvanced(self) -> None:
nt["latexsvg"] = frm.latexsvg.isChecked()
nt["latexPre"] = str(frm.latexHeader.toPlainText())
nt["latexPost"] = str(frm.latexFooter.toPlainText())
nt["loadBalancerDisperseSiblings"] = frm.disperseSiblings.isChecked()
update_notetype_legacy(parent=self, notetype=nt).success(
self.refresh_list
).run_in_background()
Expand Down
2 changes: 2 additions & 0 deletions qt/aqt/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def setup_collection(self) -> None:
form.showProgress.setChecked(reviewing.show_remaining_due_counts)
form.showPlayButtons.setChecked(not reviewing.hide_audio_play_buttons)
form.interrupt_audio.setChecked(reviewing.interrupt_audio_when_answering)
form.load_balancer_enable.setChecked(reviewing.load_balancer_enable)

editing = self.prefs.editing
form.useCurrent.setCurrentIndex(
Expand Down Expand Up @@ -157,6 +158,7 @@ def update_collection(self, on_done: Callable[[], None]) -> None:
reviewing.time_limit_secs = form.timeLimit.value() * 60
reviewing.hide_audio_play_buttons = not self.form.showPlayButtons.isChecked()
reviewing.interrupt_audio_when_answering = self.form.interrupt_audio.isChecked()
reviewing.load_balancer_enable = self.form.load_balancer_enable.isChecked()

editing = self.prefs.editing
editing.adding_defaults_to_current_deck = not form.useCurrent.currentIndex()
Expand Down
1 change: 1 addition & 0 deletions rslib/src/backend/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ impl From<BoolKeyProto> for BoolKey {
BoolKeyProto::RandomOrderReposition => BoolKey::RandomOrderReposition,
BoolKeyProto::ShiftPositionOfExistingCards => BoolKey::ShiftPositionOfExistingCards,
BoolKeyProto::RenderLatex => BoolKey::RenderLatex,
BoolKeyProto::LoadBalancerEnable => BoolKey::LoadBalancerEnable,
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions rslib/src/collection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use crate::notetype::Notetype;
use crate::notetype::NotetypeId;
use crate::progress::ProgressState;
use crate::scheduler::queue::CardQueues;
use crate::scheduler::states::load_balancer::LoadBalancer;
use crate::scheduler::SchedulerInfo;
use crate::storage::SchemaVersion;
use crate::storage::SqliteStorage;
Expand Down Expand Up @@ -138,6 +139,7 @@ pub struct CollectionState {
/// identical backups.
pub(crate) last_backup_modified: Option<TimestampMillis>,
pub(crate) progress: Arc<Mutex<ProgressState>>,
pub(crate) load_balancer: Option<LoadBalancer>,
dae marked this conversation as resolved.
Show resolved Hide resolved
}

pub struct Collection {
Expand Down
1 change: 1 addition & 0 deletions rslib/src/config/bool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ pub enum BoolKey {
WithScheduling,
WithDeckConfigs,
Fsrs,
LoadBalancerEnable,
#[strum(to_string = "normalize_note_text")]
NormalizeNoteText,
#[strum(to_string = "dayLearnFirst")]
Expand Down
2 changes: 2 additions & 0 deletions rslib/src/deckconfig/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ const DEFAULT_DECK_CONFIG_INNER: DeckConfigInner = DeckConfigInner {
historical_retention: 0.9,
weight_search: String::new(),
ignore_revlogs_before_date: String::new(),
load_balancer_only_count_self: false,
load_balancer_hide_from_others: false,
};

impl Default for DeckConfig {
Expand Down
12 changes: 12 additions & 0 deletions rslib/src/deckconfig/schema11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ pub struct DeckConfSchema11 {
sm2_retention: f32,
#[serde(default)]
weight_search: String,
#[serde(default)]
load_balancer_only_count_self: bool,
#[serde(default)]
load_balancer_hide_from_others: bool,

#[serde(flatten)]
other: HashMap<String, Value>,
Expand Down Expand Up @@ -309,6 +313,8 @@ impl Default for DeckConfSchema11 {
sm2_retention: 0.9,
weight_search: "".to_string(),
ignore_revlogs_before_date: "".to_string(),
load_balancer_only_count_self: false,
load_balancer_hide_from_others: false,
}
}
}
Expand Down Expand Up @@ -388,6 +394,8 @@ impl From<DeckConfSchema11> for DeckConfig {
desired_retention: c.desired_retention,
historical_retention: c.sm2_retention,
weight_search: c.weight_search,
load_balancer_only_count_self: c.load_balancer_only_count_self,
load_balancer_hide_from_others: c.load_balancer_hide_from_others,
other: other_bytes,
},
}
Expand Down Expand Up @@ -499,6 +507,8 @@ impl From<DeckConfig> for DeckConfSchema11 {
sm2_retention: i.historical_retention,
weight_search: i.weight_search,
ignore_revlogs_before_date: i.ignore_revlogs_before_date,
load_balancer_only_count_self: i.load_balancer_only_count_self,
load_balancer_hide_from_others: i.load_balancer_hide_from_others,
}
}
}
Expand Down Expand Up @@ -531,6 +541,8 @@ static RESERVED_DECKCONF_KEYS: Set<&'static str> = phf_set! {
"sm2Retention",
"weightSearch",
"ignoreRevlogsBeforeDate",
"loadBalancerOnlyCountSelf",
"loadBalancerHideFromOthers",
};

static RESERVED_DECKCONF_NEW_KEYS: Set<&'static str> = phf_set! {
Expand Down
1 change: 1 addition & 0 deletions rslib/src/notetype/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ impl Notetype {
css: DEFAULT_CSS.into(),
latex_pre: DEFAULT_LATEX_HEADER.into(),
latex_post: DEFAULT_LATEX_FOOTER.into(),
load_balancer_disperse_siblings: true,
..Default::default()
}
}
Expand Down
8 changes: 7 additions & 1 deletion rslib/src/notetype/schema11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use crate::notetype::NoteFieldConfig;
use crate::notetype::Notetype;
use crate::notetype::NotetypeConfig;
use crate::serde::default_on_invalid;
use crate::serde::default_true;
use crate::serde::deserialize_bool_from_anything;
use crate::serde::deserialize_number_from_string;
use crate::serde::is_default;
Expand Down Expand Up @@ -66,6 +67,8 @@ pub struct NotetypeSchema11 {
pub(crate) original_stock_kind: i32,
#[serde(default, skip_serializing_if = "is_default")]
pub(crate) original_id: Option<i64>,
#[serde(default = "default_true", skip_serializing_if = "is_default")]
pub(crate) load_balancer_disperse_siblings: bool,
#[serde(flatten)]
pub(crate) other: HashMap<String, Value>,
}
Expand Down Expand Up @@ -112,6 +115,7 @@ impl From<NotetypeSchema11> for Notetype {
reqs: nt.req.0.into_iter().map(Into::into).collect(),
original_stock_kind: nt.original_stock_kind,
original_id: nt.original_id,
load_balancer_disperse_siblings: nt.load_balancer_disperse_siblings,
other: other_to_bytes(&nt.other),
},
fields: nt.flds.into_iter().map(Into::into).collect(),
Expand Down Expand Up @@ -176,6 +180,7 @@ impl From<Notetype> for NotetypeSchema11 {
req: CardRequirementsSchema11(c.reqs.into_iter().map(Into::into).collect()),
original_stock_kind: c.original_stock_kind,
original_id: c.original_id,
load_balancer_disperse_siblings: c.load_balancer_disperse_siblings,
other: parse_other_fields(&c.other, &RESERVED_NOTETYPE_KEYS),
}
}
Expand All @@ -197,7 +202,8 @@ static RESERVED_NOTETYPE_KEYS: Set<&'static str> = phf_set! {
"tmpls",
"type",
"sortf",
"latexsvg"
"latexsvg",
"loadBalancerDisperseSiblings",
};

impl From<CardRequirementSchema11> for CardRequirement {
Expand Down
7 changes: 7 additions & 0 deletions rslib/src/preferences.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ impl Collection {
show_intervals_on_buttons: self
.get_config_bool(BoolKey::ShowIntervalsAboveAnswerButtons),
time_limit_secs: self.get_answer_time_limit_secs(),
load_balancer_enable: self.get_config_bool(BoolKey::LoadBalancerEnable),
})
}

Expand All @@ -117,6 +118,12 @@ impl Collection {
s.show_intervals_on_buttons,
)?;
self.set_answer_time_limit_secs(s.time_limit_secs)?;

self.set_config_bool_inner(BoolKey::LoadBalancerEnable, s.load_balancer_enable)?;
if !s.load_balancer_enable {
self.state.load_balancer = None;
}

Ok(())
}

Expand Down
Loading