Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[QUESTION] How to work with persistent conversation data across multiple processes #4452

Labels
@mattewid

Description

@mattewid

Issue I am facing

Hello,

I am facing difficulty in keeping conversations active between multiple processes for the same bot. I created a data persistence based on the BasePersistence class.,

And it works well for most of the methods, such as: get_...data(...), update...data(...) and refresh...data(...). This works well because it has the refresh..._data(...) method that is called always before a handler is executed and then the data in memory is synchronized with the data in the Data Store (Database).

And the limitation I faced was that there is no refresh_conversation_data(...) method to synchronize the local data in memory with the database and so it is not possible to keep the data synchronized between more than one process.

I run my bot in webhook mode, and there the webhook requests are distributed among processes for the same bot. (Hence the need for multiple processes).

Is there any reason not to have the refresh_conversation_data(...) method?

Traceback to the issue

No response

Related part of your code

No response

Operating System

Ubuntu 22.04.4 LTS

Version of Python, python-telegram-bot & dependencies

Bot API 6.6Python 3.10.13 (main, Sep  5 2023, 06:03:44) [GCC 11.4.0]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp