Python APScheduler不会将作业保存到mongodb数据库中

Python APScheduler不会将作业保存到mongodb数据库中,python,mongodb,flask,apscheduler,Python,Mongodb,Flask,Apscheduler,我无法将作业保存到mongodb数据库中 我尝试添加“url”:mongodb://localhost/My-db' 默认的jobstore,但它甚至不编译 scheduler = BackgroundScheduler({ 'apscheduler.jobstores.default': { 'type': 'mongodb' }, 'apscheduler.executors.default': { 'class': 'apschedu

我无法将作业保存到mongodb数据库中

我尝试添加“url”:mongodb://localhost/My-db' 默认的jobstore,但它甚至不编译

scheduler = BackgroundScheduler({
    'apscheduler.jobstores.default': {
        'type': 'mongodb'
    },
    'apscheduler.executors.default': {
        'class': 'apscheduler.executors.pool:ThreadPoolExecutor',
        'max_workers': '20'
    },
    'apscheduler.executors.processpool': {
        'type': 'processpool',
        'max_workers': '5'
    },
    'apscheduler.job_defaults.coalesce': 'false',
    'apscheduler.job_defaults.max_instances': '3',
    'apscheduler.timezone': 'UTC',
    })

所以事实上我自己发现了。问题解决了MongoClient

client = MongoClient('mongo_url')

jobstores = {
    'mongo': MongoDBJobStore(client=client)
}
executors = {
    'default': ThreadPoolExecutor(20),
    'processpool': ProcessPoolExecutor(5)
}
job_defaults = {
    'coalesce': False,
    'max_instances': 3
}

什么东西不能编译?你有什么例外吗?请发布更多详细信息。