finish_task()
  • 1 Minute to read

finish_task()


Article summary

This method indicates to the fleet that a task was finished, it will show a message and a status.

Reference

Arguments

ArgumentsTypeDefault valueDescription
resultFLEET_FINISH_STATUSStatus of the task
task_idstrNoneTask id generated by the fleet manager
messagestrNoneMessage to show on the fleet manager status

See the complete list of fleet enumerations

Return

None

Exceptions

  • TypeError

See the complete list of fleet exceptions

Usage Example

from raya.application_base import RayaApplicationBase
from raya.controllers.fleet_controller import FleetController
from raya.enumerations import FLEET_UPDATE_STATUS

class RayaApplication(RayaApplicationBase):

    async def setup(self):
        self.fleet: FleetController = await self.enable_controller('fleet')

    async def loop(self):
        self.finish_app()

    async def finish(self):
        await self.fleet.finish_task(
            result=FLEET_FINISH_STATUS.SUCCESS,
            message='finish ok'
        )

In the fleet manager you should see this on the task details.

image.png


Was this article helpful?