New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple accounts #40
Comments
One TDLib Client can manage only one account, but there is no limit on number of clients that can be created in one process. So you can create as much TDLib Clients as you want and initialize them with different database and file folders for different accounts. |
Is there a reason for this method not to work? I mean, see i run first instance, let's say phone_number is 111222, here's tdlib parameters: ( if i try to run second instance with phonenumber 333444, i'm getting this: ( after 3-5 seconds: ( |
@DerAlSem You have misprint in "database_direcotry", so the database directory isn't specified at all and current directory is used. TDLib noticed that and refused to open the same database twice. |
Unbelievably stupid typo. |
Hi! |
Yes, you can. Change "database directory" when initiating the lib.
…On Wed, Aug 28, 2019 at 1:13 PM SavostinVladimir ***@***.***> wrote:
Hi!
Is there way to store multiple sessions in arbitrary storage (without
database_directory and file_directory) with tdlib_json_client?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#40?email_source=notifications&email_token=ACO6OJ7PO65N5UNTG6JNVBLQGZFVHA5CNFSM4EPIBRN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5KTPEI#issuecomment-525678481>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACO6OJ2ESOFO7645JZE2UFDQGZFVHANCNFSM4EPIBRNQ>
.
|
No, I meant to store data in postgres for example |
@SavostinVladimir This isn't possible. You can't change a way the data is stored by TDLib. |
По-русски напишу, один фиг тут одни русские, надеюсь, гит меня за это не
забанит.
Владимир, какие данные ты хочешь хранить? Типа там файлы и т.д. всё что
прилетает? Или что-то еще? У меня все данные в sqlite хранятся. Про
пользователей, про чаты.
…On Wed, Aug 28, 2019 at 5:51 PM SavostinVladimir ***@***.***> wrote:
No, I meant to store data in postgres for example
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#40?email_source=notifications&email_token=ACO6OJ5PNQUWQHJT2OXRKU3QG2GHHA5CNFSM4EPIBRN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5LMRVQ#issuecomment-525781206>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACO6OJ6OPBGPEV3HM4DNASTQG2GHHANCNFSM4EPIBRNQ>
.
|
Я хочу хранить именно сессии. Допустим у меня 100500 разных пользователей и я не хочу их постоянно логинить через телефон и код. Мне надо хранить в постгрес данные всех этих 100500 сессий. Но в tdlib, эту заботу на себя берёт td_json_client, храня все что связано с пользователем в отдельной директории. Но создавать кучу директорий для каждого отдельного пользователя мне не подходит. |
Логинить через код и телефон не надо каждый раз. Логинишь один раз, сессия
сохраняется на диск. Именно тдлиб сохраняет ее на диск, других вариантов
нет. Но тебе какая разница? Указываешь каждому пользователю свое место
хранение и всё. В чем проблема именно?
…On Wed, Aug 28, 2019 at 7:28 PM SavostinVladimir ***@***.***> wrote:
Я хочу хранить именно сессии. Допустим у меня 100500 разных пользователей
и я не хочу их постоянно логинить через телефон и код. Мне надо хранить в
постгрес данные всех этих 100500 сессий. Но в tdlib, эту заботу на себя
берёт td_json_client, храня все что связано с пользователем в отдельной
директории. Но создавать кучу директорий для каждого отдельного
пользователя мне не подходит.
Пробовал поискать библиотеки реализующие mtproto, но там тоже максимум что
я нашёл - это сохранить одну сессию в файлик. Единственное что приходит в
голову пока, это немного поменять реализацию такой библиотеки под себя
(чтобы сессия могла загружаться/выгружаться в постгрес)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#40?email_source=notifications&email_token=ACO6OJ6QPUWVWOB3QL23OVTQG2RTTA5CNFSM4EPIBRN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5LWMQQ#issuecomment-525821506>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACO6OJ5IHVLFUR3XED4GW4DQG2RTTANCNFSM4EPIBRNQ>
.
|
Проблема в том что у меня куча микросервисов которые должны работать с этими базами, если они на одной машине то все норм. А если расширяться на несколько машин, то и все базы надо расшаривать. Именно поэтому хотелось бы найти вариант самому хэндлить сессии. Тогда я мог бы класть все в единственный инстанс постгрес, а остальные обращались бы к нему |
I love when you think you might get something out of a conversation and suddenly everyone starts to write in their mother language like |
How can I run one TDLib instance with multiple accounts?
The text was updated successfully, but these errors were encountered: