summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2023-01-05 11:36:17 +0100
committerJan Lehnardt <jan@apache.org>2023-01-05 15:21:07 +0100
commitd16fddd0a30b75001a160c76c531d98444ea50cd (patch)
tree9607431da6ae7ece4dc7cee1c62ac381b6f137ad
parent729ea9c17291df086c96672d77632674f5b2a669 (diff)
downloadcouchdb-d16fddd0a30b75001a160c76c531d98444ea50cd.tar.gz
fix: undefined function warning
-rw-r--r--src/weatherreport/src/weatherreport_check_ioq.erl9
1 files changed, 8 insertions, 1 deletions
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),