Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
This is such a dumb thing. And Spring have just sat on it for nearly 3
years, because why would you have one fundamental value parser when you
could have many?
  • Loading branch information
dkfellows committed Aug 31, 2021
1 parent 47a9566 commit 50c4aa3
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ private boolean authenticateAgainstDB(String username, String password,
}

@Override
@Scheduled(fixedDelayString = "${spalloc.auth.unlock-period:60s}")
@Scheduled(fixedDelayString = "${spalloc.auth.unlock-period:PT60S}")
public void unlockLockedUsers() throws SQLException {
try {
if (!control.isPaused()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ private static final class TriadCoords {
* @throws SQLException
* If anything goes wrong at the DB level
*/
@Scheduled(fixedDelayString = "${spalloc.allocator.period:5s}")
@Scheduled(fixedDelayString = "${spalloc.allocator.period:PT5S}")
public void allocate() throws SQLException {
if (serviceControl.isPaused()) {
return;
Expand Down Expand Up @@ -327,7 +327,7 @@ boolean allocate(Connection conn) throws SQLException {
* @throws SQLException
* If anything goes wrong at the DB level
*/
@Scheduled(fixedDelayString = "${spalloc.keepalive.expiry-period:30s}")
@Scheduled(fixedDelayString = "${spalloc.keepalive.expiry-period:PT30S}")
public void expireJobs() throws SQLException {
if (serviceControl.isPaused()) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@ private void changeBoardPowerState(BMPTransceiverInterface txrx,
// ----------------------------------------------------------------
// SERVICE IMPLEMENTATION

@Scheduled(fixedDelayString = "${spalloc.transceiver.period:10s}",
initialDelayString = "${spalloc.transceiver.period:10s}")
@Scheduled(fixedDelayString = "${spalloc.transceiver.period:PT10S}",
initialDelayString = "${spalloc.transceiver.period:PT10S}")
void mainSchedule() throws SQLException, IOException, SpinnmanException {
if (serviceControl.isPaused()) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
*
* @author Donal Fellows
*/
@Component
@Component("spalloc-v1-compatibility-service")
public class Service {
private static final int BASE_TEN = 10;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,20 @@
{
"name": "spalloc.historical-data.grace-period",
"type": "java.time.Duration",
"defaultValue": "PT14D",
"defaultValue": "P14D",
"description": "How long after job completion should we wait before moving the data?"
},
{
"name": "spalloc.allocator.period",
"type": "java.time.Duration",
"defaultValue": "5s",
"description": "Time between runs of the main allocation algorithm."
"defaultValue": "PT5S",
"description": "Time between runs of the main allocation algorithm. Note that this must be given as either a true Duration or a count of milliseconds, but *not* as an abbreviated form duration. That's a Spring bug."
},
{
"name": "spalloc.keepalive.expiry-period",
"type": "java.time.Duration",
"defaultValue": "30s",
"description": "Time between runs of the keepalive-expiry algorithm."
"defaultValue": "PT30S",
"description": "Time between runs of the keepalive-expiry algorithm. Note that this must be given as either a true Duration or a count of milliseconds, but *not* as an abbreviated form duration. That's a Spring bug."
},
{
"name": "spalloc.keepalive.min",
Expand Down Expand Up @@ -162,8 +162,8 @@
{
"name": "spalloc.transceiver.period",
"type": "java.time.Duration",
"defaultValue": "10s",
"description": "How long between when we send requests to the BMP control tasks."
"defaultValue": "PT10S",
"description": "How long between when we send requests to the BMP control tasks. Note that this must be given as either a true Duration or a count of milliseconds, but *not* as an abbreviated form duration. That's a Spring bug."
},
{
"name": "spalloc.transceiver.probe-interval",
Expand Down Expand Up @@ -228,8 +228,8 @@
{
"name": "spalloc.auth.unlock-period",
"type": "java.time.Duration",
"defaultValue": "60s",
"description": "How often do we look for users to end their lock-out?"
"defaultValue": "PT60S",
"description": "How often do we look for users to end their lock-out? Note that this must be given as either a true Duration or a count of milliseconds, but *not* as an abbreviated form duration. That's a Spring bug."
},
{
"name": "spalloc.quota.default",
Expand Down
8 changes: 4 additions & 4 deletions SpiNNaker-allocserv/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ spalloc:
schedule: "0 0 2 * * *"
keepalive:
# How long between runs of the keepalive-expiry algorithm
expiry-period: 30s
expiry-period: PT30S
# Minimum keepalive period
min: 30s
# Maximum keepalive period
max: 300s
allocator:
# How long between runs of the allocator algorithm
period: 5s
period: PT5S
# What span of importance will be considered when allocating jobs
importance-span: 10000
# Priority is the rate at which importance is accrued
Expand Down Expand Up @@ -126,15 +126,15 @@ spalloc:
# Duration of automatic log-out
account-lock-duration: PT24H
# How often do we look for users to unlock
unlock-period: 60s
unlock-period: PT60S
quota:
# Default user quota in board-seconds
default: 100
# When do we consolidate job quotas into the main quota table
consolidation-schedule: "0 0 * * * *"
transceiver:
# How long between when we send requests to the BMP control tasks
period: 10s
period: PT10S
# The basic wait time used by the BMP control tasks
probe-interval: 15s
# Number of attempts that will be made to switch on a board
Expand Down

0 comments on commit 50c4aa3

Please sign in to comment.