mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-06 03:13:43 +02:00
Log the wait before sending email
When waiting before sending email, log the wait. Fixes #1195173 [Feature Request - Multiple books emailed to device](https://bugs.launchpad.net/calibre/+bug/1195173)
This commit is contained in:
parent
c3009256c4
commit
f8509fe826
1 changed files with 4 additions and 0 deletions
|
|
@ -92,7 +92,11 @@ def __call__(self, attachment, aname, to, subject, text, log=None,
|
|||
raise worker.exception
|
||||
|
||||
def sendmail(self, attachment, aname, to, subject, text, log):
|
||||
logged = False
|
||||
while time.time() - self.last_send_time <= self.rate_limit:
|
||||
if not logged:
|
||||
log('Waiting %s seconds before sending, to avoid being marked as spam.\nYou can control this delay via Preferences->Tweaks' % self.rate_limit)
|
||||
logged = True
|
||||
time.sleep(1)
|
||||
try:
|
||||
opts = email_config().parse()
|
||||
|
|
|
|||
Loading…
Reference in a new issue