예제 #1
0
def get(peer_id):

    task = TaskManager.getTask(peer_id)
    if task == 0:
        return jsonify(), 500

    print('started json')
    json = TaskController.getAsJson(task)
    print('finished json')
    return json
예제 #2
0
파일: task.py 프로젝트: JelteF/bottor
def get(peer_id):

    task = TaskManager.getTask(peer_id)
    if task == 0:
        return jsonify(), 500

    print('started json')
    json = TaskController.getAsJson(task)
    print('finished json')
    return json
예제 #3
0
    def testShizzle(self):
        matrixA = "sample_matrices/A20"
        matrixB = "sample_matrices/B20"
        job = JobController.create(matrixA, matrixB)
        job2 = JobController.create(matrixA, matrixB)

        task1 = TaskManager.getTask(1)
        assert task1

        task2 = TaskManager.getTask(1)
        assert task2

        array = Matrix.matrices[job.getTaskMatrix()]
        MatrixController.writeArrayToFile(array, "result_matrices/test_job_cancelling_1")
        time.sleep(2)
        task3 = TaskManager.getTask(1)
        assert task3
        task4 = TaskManager.getTask(1)
        MatrixController.writeArrayToFile(array, "result_matrices/test_job_cancelling_2")
        TaskManager.cancelLongRunningTasks()
        MatrixController.writeArrayToFile(array, "result_matrices/test_job_cancelling_3")
예제 #4
0
    def testShizzle(self):
        matrixA = "sample_matrices/A20"
        matrixB = "sample_matrices/B20"
        job = JobController.create(matrixA, matrixB)
        job2 = JobController.create(matrixA, matrixB)

        task1 = TaskManager.getTask(1)
        assert task1

        task2 = TaskManager.getTask(1)
        assert task2

        array = Matrix.matrices[job.getTaskMatrix()]
        MatrixController.writeArrayToFile(
            array, "result_matrices/test_job_cancelling_1")
        time.sleep(2)
        task3 = TaskManager.getTask(1)
        assert task3
        task4 = TaskManager.getTask(1)
        MatrixController.writeArrayToFile(
            array, "result_matrices/test_job_cancelling_2")
        TaskManager.cancelLongRunningTasks()
        MatrixController.writeArrayToFile(
            array, "result_matrices/test_job_cancelling_3")