Skip to content
Merged
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions tools/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2142,15 +2142,16 @@ struct server_context {

// find the slot that has been least recently used
if (ret == nullptr) {
int64_t t_last = ggml_time_us();
int64_t t_last = -1;

for (server_slot & slot : slots) {
// skip the slot if it is not available
if (slot.is_processing()) {
continue;
}

// 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;
ret = &slot;
}
Expand Down
Loading