Commit dac50f1f authored by jtc42's avatar jtc42
Browse files

Replaced 202s with more suitable 201s

parent 76af0891
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -142,4 +142,4 @@ class TimelapseAPI(MicroscopeViewPlugin):
        self.timelapse_task = taskify(self.plugin.timelapse)(n_images)

        # Return the state of the task (will show ID, start time, and status before the task has finished)
        return jsonify(self.timelapse_task.state), 202
        return jsonify(self.timelapse_task.state), 201
+2 −2
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ An example of a long running task may look like:
        def post(self):
            # Attach the long-running method as a microscope task
            self.my_task = taskify(self.plugin.long_running_function)()
            return jsonify(self.my_task.state), 202
            return jsonify(self.my_task.state), 201

After some time, once the task has completed, it could be retreived using:

@@ -132,7 +132,7 @@ For example, a timelapse plugin may look like:
            self.timelapse_task = taskify(self.plugin.timelapse)(n_images)

            # Return the state of the task (will show ID, start time, and status before the task has finished)
            return jsonify(self.timelapse_task.state), 202
            return jsonify(self.timelapse_task.state), 201


Notice that even though we never use the stage here, we still acquire the lock. This means that during the timelapse, 
+2 −2
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ class AutofocusAPI(MicroscopeViewPlugin):
            task = taskify(self.plugin.autofocus)(dz)

            # return a handle on the autofocus task
            return jsonify(task.state), 202
            return jsonify(task.state), 201

        else:
            abort(503, "No stage connected. Unable to autofocus.")
@@ -50,7 +50,7 @@ class FastAutofocusAPI(MicroscopeViewPlugin):
            task = taskify(self.plugin.fast_autofocus)(dz, backlash=backlash)

            # return a handle on the autofocus task
            return jsonify(task.state), 202
            return jsonify(task.state), 201

        else:
            abort(503, "No stage connected. Unable to autofocus.")
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ class RecalibrateAPIView(MicroscopeViewPlugin):
        task = taskify(self.plugin.recalibrate)()

        # Return a handle on the autofocus task
        return jsonify(task.state), 202
        return jsonify(task.state), 201


class Plugin(MicroscopePlugin):
+1 −1
Original line number Diff line number Diff line
@@ -60,4 +60,4 @@ class TileScanAPI(MicroscopeViewPlugin):
        )

        # return a handle on the scan task
        return jsonify(task.state), 202
        return jsonify(task.state), 201
Loading