parent
b460d16ae8
commit
87d34b381d
1 changed files with 3 additions and 2 deletions
|
@ -2142,7 +2142,8 @@ struct server_context {
|
||||||
|
|
||||||
// find the slot that has been least recently used
|
// find the slot that has been least recently used
|
||||||
if (ret == nullptr) {
|
if (ret == nullptr) {
|
||||||
int64_t t_last = ggml_time_us();
|
int64_t t_last = -1;
|
||||||
|
|
||||||
for (server_slot & slot : slots) {
|
for (server_slot & slot : slots) {
|
||||||
// skip the slot if it is not available
|
// skip the slot if it is not available
|
||||||
if (slot.is_processing()) {
|
if (slot.is_processing()) {
|
||||||
|
@ -2150,7 +2151,7 @@ struct server_context {
|
||||||
}
|
}
|
||||||
|
|
||||||
// select the current slot if the criteria match
|
// select the current slot if the criteria match
|
||||||
if (slot.t_last_used < t_last) {
|
if (!ret || slot.t_last_used <= t_last) {
|
||||||
t_last = slot.t_last_used;
|
t_last = slot.t_last_used;
|
||||||
ret = &slot;
|
ret = &slot;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue