Comments (13)
I love when you think you might get something out of a conversation and suddenly everyone starts to write in their mother language like
from td.
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.
from td.
from td.
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:
(
[use_test_dc_] => 1
[database_direcotry] => /home/tdlib/storage/111222/db
[files_directory] => /home/tdlib/storage/111222/files
[use_message_database] => 1
[use_file_database] => 1
)
if i try to run second instance with phonenumber 333444, i'm getting this:
(
[use_test_dc_] => 1
[database_direcotry] => /home/tdlib/storage/333444/db
[files_directory] => /home/tdlib/storage/333444/files
[use_message_database] => 1
[use_file_database] => 1
)
after 3-5 seconds:
(
[@type] => error
[code] => 400
[message] => Can't lock file because it is already in use; check for another program instance running
)
from td.
@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.
from td.
Unbelievably stupid typo.
Thanks pal!
from td.
Hi!
Is there way to store multiple sessions in arbitrary storage (without database_directory and file_directory) with tdlib_json_client?
from td.
from td.
No, I meant to store data in postgres for example
from td.
@SavostinVladimir This isn't possible. You can't change a way the data is stored by TDLib.
from td.
Я хочу хранить именно сессии. Допустим у меня 100500 разных пользователей и я не хочу их постоянно логинить через телефон и код. Мне надо хранить в постгрес данные всех этих 100500 сессий. Но в tdlib, эту заботу на себя берёт td_json_client, храня все что связано с пользователем в отдельной директории. Но создавать кучу директорий для каждого отдельного пользователя мне не подходит.
Пробовал поискать библиотеки реализующие mtproto, но там тоже максимум что я нашёл - это сохранить одну сессию в файлик. Единственное что приходит в голову пока, это немного поменять реализацию такой библиотеки под себя (чтобы сессия могла загружаться/выгружаться в постгрес)
from td.
from td.
Проблема в том что у меня куча микросервисов которые должны работать с этими базами, если они на одной машине то все норм. А если расширяться на несколько машин, то и все базы надо расшаривать. Именно поэтому хотелось бы найти вариант самому хэндлить сессии. Тогда я мог бы класть все в единственный инстанс постгрес, а остальные обращались бы к нему
from td.
Related Issues (20)
- Account is cancelled HOT 1
- How to understand that this is a link to a bot? HOT 2
- Share phone number with bot HOT 2
- Separate message_ids in the same post HOT 3
- PHP code fails to compile: `Unsupported tl-schema version -1` HOT 10
- Unknown error in class "messageReplyToMessage" HOT 1
- "Request is empty" on authorization in Ubuntu HOT 4
- How do I launch the bot correctly? HOT 2
- Can someone show the references of the SetAuthenticationPhoneNumber() function HOT 3
- Telegram
- I need to build libtdjsonandroid to work on android using Unity (C#) HOT 1
- GetSupergroup return error "400 Invalid supergroup identifier" HOT 1
- Why I cannot create this json format to send text? HOT 8
- user-bot rate limit HOT 6
- Isn't there an instant way to change the hint password? HOT 3
- How to buy/subscribe to Telegram Business/Premium on Test DC? HOT 2
- Problem with secret messaging in Telegram X HOT 3
- Exclude x86 libs from android build? HOT 1
- When send voicenote with own client official desktop telegram shows it strange HOT 8
- [static const] please write code that complies with the C++ standard HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from td.