Skip to content

Commit

Permalink
squash w/ delay rule claim APIs.
Browse files Browse the repository at this point in the history
  • Loading branch information
korydraughn committed Nov 7, 2024
1 parent 092ed28 commit 371262d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/api/src/rc_delay_rule_claim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ auto rc_delay_rule_claim(RcComm* _comm, DelayRuleClaimInput* _input) -> int
return SYS_INVALID_INPUT_PARAM;
}

return procApiRequest(_comm, DELAY_RULE_TAG_AN, _input, nullptr, nullptr, nullptr);
return procApiRequest(_comm, DELAY_RULE_CLAIM_AN, _input, nullptr, nullptr, nullptr);
} // rc_delay_rule_claim
4 changes: 2 additions & 2 deletions lib/core/include/irods/rcMisc.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ void clearRescQuotaInp(void* _p);

void clearGenquery2Input(void* _p);

void clearDelayRuleTagInput(void* _p);
void clearDelayRuleClaimInput(void* _p);

void clearDelayRuleTagClearInput(void* _p);
void clearDelayRuleClaimRemoveInput(void* _p);

// clang-format off
__attribute__((deprecated("SimpleQuery is deprecated. Use GenQuery or SpecificQuery instead.")))
Expand Down
12 changes: 6 additions & 6 deletions server/core/include/irods/irods_api_calling_functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1058,17 +1058,17 @@ int call_genquery2_inout(irods::api_entry*, rsComm_t*, genquery2Inp_t*, char**);
#endif

#ifdef CREATE_API_TABLE_FOR_SERVER
int call_delay_rule_tag(irods::api_entry*, rsComm_t*, delayRuleTagInp_t*);
# define CALL_DELAY_RULE_TAG call_delay_rule_tag
int call_delay_rule_claim(irods::api_entry*, rsComm_t*, delayRuleClaimInp_t*);
# define CALL_DELAY_RULE_CLAIM call_delay_rule_claim
#else
# define CALL_DELAY_RULE_TAG nullptr // NOLINT(cppcoreguidelines-macro-usage)
# define CALL_DELAY_RULE_CLAIM nullptr // NOLINT(cppcoreguidelines-macro-usage)
#endif

#ifdef CREATE_API_TABLE_FOR_SERVER
int call_delay_rule_tag_clear(irods::api_entry*, rsComm_t*, delayRuleTagClearInp_t*);
# define CALL_DELAY_RULE_TAG_CLEAR call_delay_rule_tag_clear
int call_delay_rule_claim_remove(irods::api_entry*, rsComm_t*, delayRuleClaimRemoveInp_t*);
# define CALL_DELAY_RULE_CLAIM_REMOVE call_delay_rule_claim_remove
#else
# define CALL_DELAY_RULE_TAG_CLEAR nullptr // NOLINT(cppcoreguidelines-macro-usage)
# define CALL_DELAY_RULE_CLAIM_REMOVE nullptr // NOLINT(cppcoreguidelines-macro-usage)
#endif

#endif // IRODS_API_CALLING_FUNCTIONS_HPP
12 changes: 6 additions & 6 deletions server/core/src/irods_api_calling_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1150,12 +1150,12 @@ int call_genquery2_inout(irods::api_entry* _api, rsComm_t* _comm, genquery2Inp_t
return _api->call_handler<genquery2Inp_t*, char**>(_comm, _inp, _out);
} // call_genquery2_inout

int call_delay_rule_tag(irods::api_entry* _api, rsComm_t* _comm, delayRuleTagInp_t* _inp)
int call_delay_rule_claim(irods::api_entry* _api, rsComm_t* _comm, delayRuleClaimInp_t* _inp)
{
return _api->call_handler<delayRuleTagInp_t*>(_comm, _inp);
} // call_delay_rule_tag
return _api->call_handler<delayRuleClaimInp_t*>(_comm, _inp);
} // call_delay_rule_claim

int call_delay_rule_tag_clear(irods::api_entry* _api, rsComm_t* _comm, delayRuleTagClearInp_t* _inp)
int call_delay_rule_claim_remove(irods::api_entry* _api, rsComm_t* _comm, delayRuleClaimRemoveInp_t* _inp)
{
return _api->call_handler<delayRuleTagClearInp_t*>(_comm, _inp);
} // call_delay_rule_tag_clear
return _api->call_handler<delayRuleClaimRemoveInp_t*>(_comm, _inp);
} // call_delay_rule_claim_remove
4 changes: 2 additions & 2 deletions server/delay_server/src/irodsDelayServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,8 @@ namespace
// attempting to execute the same delay rule simultaneously.
DelayRuleClaimInput input{};
rule_id.copy(input.rule_id, sizeof(DelayRuleClaimInput::rule_id));
boost::asio::ip::host_name().copy(input.execution_host, sizeof(DelayRuleClaimInput::execution_host));
input.execution_host_pid = getpid();
boost::asio::ip::host_name().copy(input.delay_server_host, sizeof(DelayRuleClaimInput::delay_server_host));
input.delay_server_pid = getpid();

if (const auto ec = rc_delay_rule_claim(static_cast<RcComm*>(conn), &input); ec < 0) {
log_ds::trace("{}: Rule ID [{}] has already been claimed. Removing from queue.", __func__, rule_id);
Expand Down

0 comments on commit 371262d

Please sign in to comment.