Files
sheepit-shadow-nabber/src/main/java/com/sheepit/client/exception/SheepItExceptionServerOverloaded.java

41 lines
1.3 KiB
Java
Raw Normal View History

2016-10-04 06:33:25 +02:00
/*
* Copyright (C) 2016 Laurent CLOUET
* Author Laurent CLOUET <laurent.clouet@nopnop.net>
*
* This program is free software; you can redistribute it and/or
2016-10-04 06:33:25 +02:00
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2
* of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package com.sheepit.client.exception;
2023-12-07 15:29:58 +00:00
import java.util.concurrent.ThreadLocalRandom;
public class SheepItExceptionServerOverloaded extends SheepItExceptionWithRequiredWait {
2023-01-28 11:45:20 +00:00
public SheepItExceptionServerOverloaded() {
super();
}
2024-06-03 14:02:30 +00:00
public SheepItExceptionServerOverloaded(String message) {
super(message);
}
2023-12-07 15:29:58 +00:00
2024-06-03 14:02:30 +00:00
@Override public String getHumanText() {
2023-12-07 15:29:58 +00:00
return "The server is overloaded and cannot allocate a job. Will try again at %tR";
}
2024-06-03 14:02:30 +00:00
@Override public int getWaitDuration() {
2023-12-07 15:29:58 +00:00
return 1000 * 60 * ThreadLocalRandom.current().nextInt(10, 30 + 1);
}
}