foiaghost incremental and ssl error
This commit is contained in:
parent
8ef59d3d3c
commit
41299e8b97
@ -4,7 +4,7 @@
|
|||||||
por bkr --recipe examples.fruits.recipe show
|
por bkr --recipe examples.fruits.recipe show
|
||||||
por bkr --recipe examples.fruits.recipe reset
|
por bkr --recipe examples.fruits.recipe reset
|
||||||
por bkr --recipe examples.fruits.recipe run --input words=examples/fruits.csv
|
por bkr --recipe examples.fruits.recipe run --input words=examples/fruits.csv
|
||||||
por bkr --recipe examples.fruits.recipe show
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Michael's Email
|
## Michael's Email
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
from ssl import SSLCertVerificationError, SSLError
|
||||||
import httpx
|
import httpx
|
||||||
from beakers.beakers import Beaker
|
from beakers.beakers import Beaker
|
||||||
from beakers.recipe import Recipe
|
from beakers.recipe import Recipe
|
||||||
@ -32,5 +33,13 @@ recipe.add_transform(
|
|||||||
"good_urls",
|
"good_urls",
|
||||||
"responses",
|
"responses",
|
||||||
add_response,
|
add_response,
|
||||||
error_map={(httpx.ConnectError, httpx.ConnectTimeout): "bad_requests"},
|
error_map={
|
||||||
|
(
|
||||||
|
httpx.ConnectError,
|
||||||
|
httpx.ConnectTimeout,
|
||||||
|
httpx.ReadTimeout,
|
||||||
|
SSLCertVerificationError,
|
||||||
|
SSLError,
|
||||||
|
): "bad_requests"
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
@ -68,7 +68,8 @@ class SqliteBeaker(Beaker):
|
|||||||
|
|
||||||
def add_item(self, item: dict, from_table=None, from_id=None) -> None:
|
def add_item(self, item: dict, from_table=None, from_id=None) -> None:
|
||||||
self.cursor.execute(
|
self.cursor.execute(
|
||||||
f"INSERT INTO {self.name} (data) VALUES (?)", (json.dumps(item),)
|
f"INSERT INTO {self.name} (data, from_table, from_id) VALUES (?, ?, ?)",
|
||||||
|
(json.dumps(item), from_table, from_id),
|
||||||
)
|
)
|
||||||
self.recipe.db.commit()
|
self.recipe.db.commit()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user