You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2023/01/05 12:50:54 UTC

[couchdb] branch main updated: fix: undefined function warning

This is an automated email from the ASF dual-hosted git repository.

jan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/main by this push:
     new 33d9a841b fix: undefined function warning
33d9a841b is described below

commit 33d9a841b3552fa1946fe17bba3e1358a77b2d8c
Author: Jan Lehnardt <ja...@apache.org>
AuthorDate: Thu Jan 5 11:36:17 2023 +0100

    fix: undefined function warning
---
 src/weatherreport/src/weatherreport_check_ioq.erl | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/weatherreport/src/weatherreport_check_ioq.erl b/src/weatherreport/src/weatherreport_check_ioq.erl
index a0e0b0e60..2a20b78ad 100644
--- a/src/weatherreport/src/weatherreport_check_ioq.erl
+++ b/src/weatherreport/src/weatherreport_check_ioq.erl
@@ -85,7 +85,14 @@ check(Opts) ->
     end.
 
 -spec check_legacy(list()) -> [{atom(), term()}].
-check_legacy(_Opts) ->
+check_legacy(Opts) ->
+    case erlang:function_exported(ioq, get_disk_queues, 0) of
+        true -> check_legacy_int(Opts);
+        false -> [{warning, {ioq_requests_unknown, undef}}]
+    end.
+
+-spec check_legacy_int(list()) -> [{atom(), term()}].
+check_legacy_int(_Opts) ->
     case ioq:get_disk_queues() of
         Queues when is_list(Queues) ->
             Total = sum_queues(Queues, 0),