Skip to content

Notify call no more working in 0.9.4 and newer with fastapi events #610

@stefapi

Description

@stefapi

try this sample application:

# services/users/project/try_fail.py

import uvicorn
import apprise
from fastapi import FastAPI

app = FastAPI(
    title="apprise_failure",
    description="A sample",
)

@app.on_event("startup")
def system_startup():
        apobj = apprise.Apprise()
        apobj.notify(body = "Application Startup", title = "startup failed")
        print("passed !")


def main():
    uvicorn.run(
        "try_fail:app",
        host="0.0.0.0",
        port=9000,
        reload=True,
        reload_dirs=["."],
        debug=True,
        log_level='debug',
        log_config=None,
        workers=1,
        forwarded_allow_ips="*",
    )

if __name__ == "__main__":
    main()

This application works well with apprise 0.9.3 but does not work anymore with 0.9.4 and more recent versions.
You may use any recent version of fastapi and uvicorn.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions