-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
74 additions
and
3 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...eposit-core/src/main/java/org/eclipse/pass/deposit/service/DeploymentTestDataService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...posit-core/src/main/java/org/eclipse/pass/deposit/support/jobs/DeploymentTestDataJob.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright 2024 Johns Hopkins University | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.eclipse.pass.deposit.support.jobs; | ||
|
||
import org.eclipse.pass.deposit.service.DeploymentTestDataService; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; | ||
import org.springframework.scheduling.annotation.Scheduled; | ||
import org.springframework.stereotype.Component; | ||
|
||
@ConditionalOnExpression( | ||
"'${pass.test.data.job.enabled}'=='true' and '${pass.deposit.jobs.disabled}'=='false'" | ||
) | ||
@Component | ||
public class DeploymentTestDataJob { | ||
|
||
private static final Logger LOG = LoggerFactory.getLogger(DeploymentTestDataJob.class); | ||
|
||
private final DeploymentTestDataService deploymentTestDataService; | ||
|
||
public DeploymentTestDataJob(DeploymentTestDataService deploymentTestDataService) { | ||
this.deploymentTestDataService = deploymentTestDataService; | ||
} | ||
|
||
@Scheduled( | ||
fixedDelayString = "${pass.test.data.job.interval-ms}", | ||
initialDelayString = "${pass.deposit.jobs.3.init.delay}" | ||
) | ||
public void processDeploymentTestData() { | ||
LOG.warn("Starting {}", this.getClass().getSimpleName()); | ||
try { | ||
deploymentTestDataService.processTestData(); | ||
} catch (Exception e) { | ||
LOG.error("DeploymentTestDataJob execution failed: {}", e.getMessage(), e); | ||
} | ||
LOG.warn("Finished {}", this.getClass().getSimpleName()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ pass.deposit.jobs.disabled=false | |
pass.deposit.jobs.default-interval-ms=600000 | ||
pass.deposit.jobs.1.init.delay=5000 | ||
pass.deposit.jobs.2.init.delay=10000 | ||
pass.deposit.jobs.3.init.delay=20000 | ||
|
||
jscholarship.hack.sword.statement.uri-prefix=http://dspace-prod.mse.jhu.edu:8080/swordv2/ | ||
jscholarship.hack.sword.statement.uri-replacement=https://jscholarship.library.jhu.edu/swordv2/ | ||
|
@@ -67,5 +68,8 @@ pass.deposit.nihms.email.delay=720000 | |
pass.deposit.nihms.email.auth=${NIHMS_MAIL_AUTH:LOGIN} | ||
pass.deposit.nihms.email.from=${PASS_DEPOSIT_NIHMS_EMAIL_FROM:[email protected]} | ||
|
||
pass.test.data.job.enabled=false | ||
# Run every 12 hours | ||
pass.test.data.job.interval-ms=43200000 | ||
pass.test.data.policy.title=${TEST_DATA_POLICY_TITLE:} | ||
pass.test.data.user.email=${TEST_DATA_USER_EMAIL:} |
2 changes: 1 addition & 1 deletion
2
...osit-core/src/test/java/org/eclipse/pass/deposit/service/DeploymentTestDataServiceIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters