From a5780449fc7a27a6118533cc2ffd351e50a0adbc Mon Sep 17 00:00:00 2001 From: xuu Date: Sun, 1 Oct 2023 16:56:28 -0600 Subject: [PATCH] fix: error --- .ansible/playbook.yml | 12 ++++++------ app/peerfinder/http.go | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.ansible/playbook.yml b/.ansible/playbook.yml index 12291fb..afd0176 100644 --- a/.ansible/playbook.yml +++ b/.ansible/playbook.yml @@ -10,12 +10,12 @@ owner: root group: root - - name: Copy build to remote - ansible.builtin.copy: - src: ev.service - dest: /etc/systemd/system/ev.service - owner: root - group: root + # - name: Copy build to remote + # ansible.builtin.copy: + # src: ev.service + # dest: /etc/systemd/system/ev.service + # owner: root + # group: root - name: Restart service systemd: diff --git a/app/peerfinder/http.go b/app/peerfinder/http.go index 6574ca7..aed6f58 100644 --- a/app/peerfinder/http.go +++ b/app/peerfinder/http.go @@ -304,7 +304,7 @@ func (s *service) getResults(w http.ResponseWriter, r *http.Request) { sort.Sort(sort.Reverse(requests)) args := requestArgs(r) - args.Requests = requests[:maxResults] + args.Requests = requests[:min(maxResults, len(requests))] s.state.Use(ctx, func(ctx context.Context, state *state) error { args.CountPeers = len(state.peers)