|
79 | 79 | -dialyzer({nowarn_function, [foreach_transient/1, |
80 | 80 | foreach_transient_in_khepri/1]}). |
81 | 81 |
|
| 82 | +%% Ignored because of changes in the Khepri adv API. See comments within |
| 83 | +%% these functions. |
| 84 | +-dialyzer({nowarn_function, [delete_in_khepri_tx/2, |
| 85 | + update_in_khepri/2, |
| 86 | + update_decorators_in_khepri/2, |
| 87 | + do_delete_transient_queues_in_khepri_tx/2]}). |
| 88 | + |
82 | 89 | -define(MNESIA_TABLE, rabbit_queue). |
83 | 90 | -define(MNESIA_DURABLE_TABLE, rabbit_durable_queue). |
84 | 91 |
|
@@ -409,23 +416,26 @@ delete_in_khepri(QueueName) -> |
409 | 416 | delete_in_khepri(QueueName, OnlyDurable) -> |
410 | 417 | rabbit_khepri:transaction( |
411 | 418 | fun () -> |
412 | | - Path = khepri_queue_path(QueueName), |
413 | | - case khepri_tx_adv:delete(Path) of |
414 | | - %% Khepri 0.16 and below returned `khepri:node_props()' for |
415 | | - %% adv queries and commands targeting one node: |
416 | | - {ok, #{data := _}} -> |
417 | | - %% we want to execute some things, as decided by rabbit_exchange, |
418 | | - %% after the transaction. |
419 | | - rabbit_db_binding:delete_for_destination_in_khepri(QueueName, OnlyDurable); |
420 | | - %% Khepri 0.17+ returns `khepri_adv:node_props_map()` |
421 | | - %% instead. |
422 | | - {ok, #{Path := #{data := _}}} -> |
423 | | - rabbit_db_binding:delete_for_destination_in_khepri(QueueName, OnlyDurable); |
424 | | - {ok, _} -> |
425 | | - ok |
426 | | - end |
| 419 | + delete_in_khepri_tx(QueueName, OnlyDurable) |
427 | 420 | end, rw). |
428 | 421 |
|
| 422 | +delete_in_khepri_tx(QueueName, OnlyDurable) -> |
| 423 | + Path = khepri_queue_path(QueueName), |
| 424 | + case khepri_tx_adv:delete(Path) of |
| 425 | + %% Khepri 0.16 and below returned `khepri:node_props()' for |
| 426 | + %% adv queries and commands targeting one node: |
| 427 | + {ok, #{data := _}} -> |
| 428 | + %% we want to execute some things, as decided by rabbit_exchange, |
| 429 | + %% after the transaction. |
| 430 | + rabbit_db_binding:delete_for_destination_in_khepri(QueueName, OnlyDurable); |
| 431 | + %% Khepri 0.17+ returns `khepri_adv:node_props_map()` |
| 432 | + %% instead. |
| 433 | + {ok, #{Path := #{data := _}}} -> |
| 434 | + rabbit_db_binding:delete_for_destination_in_khepri(QueueName, OnlyDurable); |
| 435 | + {ok, _} -> |
| 436 | + ok |
| 437 | + end. |
| 438 | + |
429 | 439 | %% ------------------------------------------------------------------- |
430 | 440 | %% internal_delete(). |
431 | 441 | %% ------------------------------------------------------------------- |
|
0 commit comments