-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: move time limit logic to a mixin and respect real time
- Loading branch information
1 parent
4102754
commit cff49f6
Showing
8 changed files
with
205 additions
and
79 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,27 @@ | ||
# This file is part of the QuestionPy Server. (https://questionpy.org) | ||
# The QuestionPy Server is free software released under terms of the MIT license. See LICENSE.md. | ||
# (c) Technische Universität Berlin, innoCampus <[email protected]> | ||
from questionpy_server.worker.runtime.messages import BaseWorkerError | ||
|
||
|
||
class WorkerNotRunningError(Exception): | ||
class WorkerNotRunningError(BaseWorkerError): | ||
pass | ||
|
||
|
||
class WorkerStartError(Exception): | ||
class WorkerStartError(BaseWorkerError): | ||
pass | ||
|
||
|
||
class WorkerCPUTimeLimitExceededError(Exception): | ||
pass | ||
class WorkerCPUTimeLimitExceededError(BaseWorkerError): | ||
def __init__(self, limit: float): | ||
self.limit = limit | ||
super().__init__(f"Worker has exceeded its CPU time limit of {limit} seconds and was killed.") | ||
|
||
|
||
class WorkerRealTimeLimitExceededError(BaseWorkerError): | ||
def __init__(self, limit: float): | ||
self.limit = limit | ||
super().__init__(f"Worker has exceeded its real time limit of {limit} seconds and was killed.") | ||
|
||
|
||
class StaticFileSizeMismatchError(Exception): | ||
|
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
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
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
Oops, something went wrong.