'Is there a a way for an arq worker to abort a running job?

I would like to know if it's possible to abort a running job from the worker instance.

I have copied a sample program from this thread: https://github.com/tiangolo/fastapi/issues/520#issuecomment-779219914

Thanks to anyone who can give me any info on this.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source