Error while using bot.get_updates() for telegram bot in python - telegram-bot

I made a Telegram bot, and even after multiple tries, every time I try
print(bot.get_updates()), it returns me []. I also ran a logging function, but it just says multiple instances are running, when I am running just one. What are the possible reasons?

print(bot.get_updates()), it returns me []
Then your didn't get any (new) updates yet.
I also ran a logging function, but it just says multiple instances are running, when I am running just one. What are the possible reasons?
Only one process at a time may fetch updates from Telegram. Make sure that you have only one process running that fetches updates (either via get_updates or via a webhook)

Related

Data creation via BAPI is intermittently inoperative despite committing updates

I have the following case:
I'm creating transports documents in a LOOP (using BAPI_CREATE). After this loop, if everything is fine, I call BAPI_TRANSACTION_COMMIT (and wait = 'X').
After that, I do another loop for the created transports to change them. But not everytime I can change the first transport (the LAST created). Could it be because that commit work has not been performed properly at all? I used WAIT UP TO 3 SECONDS before the second loop, and it worked; but I would find out the real problem and how to solve it.
Thanks.
These are different processes, even with commit and wait.
try to experiment with
SET UPDATE TASK LOCAL.

Running simultaneous operations in Mailcore2

Is it possible to run multiple operations simultaneously? I'm downloading emails in the background through an operation. When my users open an email to view it I start another operation to get the message - this doesn't run until the downloading operations are complete.
You can adjust the property allowsFolderConcurrentAccessEnabled if you think you're always be on a server that supports it.
Additionally, when you fetch a message, you can use a urgent flag to tell if you need to fetch it as soon as possible. It will make operation run simultaneously.
- (MCOIMAPFetchContentOperation *) fetchMessageOperationWithFolder:(NSString *)folder
uid:(uint32_t)uid
urgent:(BOOL)urgent;

Apache crash when sending mass email through third party

I have a LAMP stack setup on Digital Ocean (Ubunu 12.04) that is pretty stable. The only time we have had a crash is when we sent out a mass email to about 30,000 people. We are not using the server to send the message, but a third-party email service (iContact). I watch the server with Top and can see it fill up with apache entries (each taking about 20MB) for a short while then drop back down after the mail has finished being sent.
I have successfully adjusted the apache settings to no longer crash - it just slows down for a bit. These are not hits to the pages, but something is making apache ramp up and spin off a ton of workers during the email send process.
My question is, where do I look to get some idea of what is happening? Unfortunately iContact has been no help and the log files I've looked at aren't telling me much, so I think I'm likely looking in the wrong place.
I used to send emails to over 200,000 people directly from a single machine. Trying to do it from a webpage is pretty crazy, so I wrote a command-line based script to first write it into a database, and then send ~50 at a time from the database, deleting as it went.
With Symfony/Swiftmailer it is pretty easy these days - the sending part is just a shell script that keeps running 'app/console swiftmailer:spool:send', sleeping and restarting till the database is empty.

Distributing requests to Selenium Grid RC's?

I've got a situation here where I have a central selenium grid hub, and several RC's running on my gogrid account. When I access it to run tests, it basically queues all the incoming test requests and executes them serially on only one of the RC's, instead of spreading them out to use available RC's. The tests come from multiple projects, so I'm not looking to parallelize the tests themselves, just to split the requests that come from multiple projects across the multiple RC's. From everything I've read, it seems like selenium grid should be doing this already, yet I only see one RC used to run every single test. Is there something I'm missing?
Do you have multiple RCs registered with the same environment? Each worker can currently only broadcast one environment and the hub assigns work to workers in a circular queue fashion (first registered gets work first).
http://selenium-grid.seleniumhq.org/configuring-and-tuning.html

Tracking Chrome and its many processes

I'm trying to keep an eye on how long an application runs. To do this, I capture every process's ID as it starts, and when that process is shut down, I log the time. However, Google's Chrome starts and stops like 6 processes when you start it up and shut it down, meaning each execution of Chrome gets logged multiple times.
Is there a better way to track the execution of an application than by process ID? Or is there, perhaps, a technique for getting around this particular problem? I'd considered not adding a process ID if a process with the same ID was added within a second or so, but that seems exploitable.
Any ideas?
I am not 100% but I would assume that one process in Chrome must be the parent. try eliminating processes from your list if their parent (PPID) is the same (and not init = PID 1)
I ended up just checking if I was adding a duplicate. Not very efficient, but easy and effective. It will serve for now.