mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] pms: add sleep to prevent ban from GC
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import time
|
||||
|
||||
import requests
|
||||
from bs4 import BeautifulSoup as bs
|
||||
|
||||
@@ -64,6 +66,7 @@ class PmsProperty(models.Model):
|
||||
data=login_payload,
|
||||
verify=get_module_resource("pms_l10n_es", "static", "cert.pem"),
|
||||
)
|
||||
time.sleep(1)
|
||||
# logout
|
||||
session.get(
|
||||
url + logout_route,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import base64
|
||||
import datetime
|
||||
import os
|
||||
import time
|
||||
from datetime import date
|
||||
|
||||
import requests
|
||||
@@ -196,6 +197,7 @@ class TravellerReport(models.TransientModel):
|
||||
files = {
|
||||
"fichero": open(pwd + pms_property.institution_user + ".999", "rb")
|
||||
}
|
||||
time.sleep(1)
|
||||
|
||||
# send file
|
||||
response_file_sent = session.post(
|
||||
@@ -207,6 +209,7 @@ class TravellerReport(models.TransientModel):
|
||||
# remove file locally
|
||||
os.remove(pwd + pms_property.institution_user + ".999")
|
||||
|
||||
time.sleep(1)
|
||||
# logout & close connection
|
||||
session.get(
|
||||
url + logout_route,
|
||||
|
||||
Reference in New Issue
Block a user