cache last heartbeat list in memory
This commit is contained in:
13
server/limit-array.js
Normal file
13
server/limit-array.js
Normal file
@@ -0,0 +1,13 @@
|
||||
class LimitArray {
|
||||
limit = 100;
|
||||
array = [];
|
||||
|
||||
add(item) {
|
||||
this.array.push(item);
|
||||
if (this.array.length > this.limit) {
|
||||
this.array.shift();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = LimitArray;
|
||||
Reference in New Issue
Block a user