syncmodels 0.1.345__py2.py3-none-any.whl → 0.1.347__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- syncmodels/__init__.py +2 -2
- syncmodels/runner.py +12 -2
- syncmodels/schema.py +0 -2
- syncmodels/session/__init__.py +2 -14
- {syncmodels-0.1.345.dist-info → syncmodels-0.1.347.dist-info}/METADATA +2 -2
- {syncmodels-0.1.345.dist-info → syncmodels-0.1.347.dist-info}/RECORD +11 -11
- {syncmodels-0.1.345.dist-info → syncmodels-0.1.347.dist-info}/AUTHORS.rst +0 -0
- {syncmodels-0.1.345.dist-info → syncmodels-0.1.347.dist-info}/LICENSE +0 -0
- {syncmodels-0.1.345.dist-info → syncmodels-0.1.347.dist-info}/WHEEL +0 -0
- {syncmodels-0.1.345.dist-info → syncmodels-0.1.347.dist-info}/entry_points.txt +0 -0
- {syncmodels-0.1.345.dist-info → syncmodels-0.1.347.dist-info}/top_level.txt +0 -0
syncmodels/__init__.py
CHANGED
syncmodels/runner.py
CHANGED
@@ -31,7 +31,7 @@ class iRunner:
|
|
31
31
|
STATS_DISPATCH = "dispatch"
|
32
32
|
STATS_IDLE = "idle"
|
33
33
|
|
34
|
-
FAILURE_POLICY = FailurePolicy.
|
34
|
+
FAILURE_POLICY = FailurePolicy.RETRY
|
35
35
|
|
36
36
|
def __init__(
|
37
37
|
self,
|
@@ -109,14 +109,24 @@ class iRunner:
|
|
109
109
|
log.error(msg)
|
110
110
|
field = str(why)
|
111
111
|
self._stats(field)
|
112
|
+
|
113
|
+
log.error(
|
114
|
+
"FAILURE_POLICY: %s, %s (%s)", self.FAILURE_POLICY, self.uri, self
|
115
|
+
)
|
112
116
|
if self.FAILURE_POLICY == FailurePolicy.STOP:
|
117
|
+
log.error("Stopping Runner: %s (%s)", self.uri, self)
|
113
118
|
self.running = False
|
114
119
|
elif self.FAILURE_POLICY == FailurePolicy.RAISE:
|
120
|
+
# NOTE: this will stop the fiber in asyncio
|
121
|
+
# NOTE: you'd rather use FailurePolicy.RAISE
|
122
|
+
log.error("Raise RuntimeError(%s)", msg)
|
115
123
|
raise RuntimeError(msg)
|
116
124
|
else:
|
117
125
|
# add same task to be executed later on
|
118
126
|
# using a scheduled queue, not just a simple queue
|
119
|
-
|
127
|
+
retry = 300
|
128
|
+
log.error("Retry Task in (%s) secs", retry)
|
129
|
+
self.input_queue.push(task, monotonic() + retry)
|
120
130
|
await self.idle()
|
121
131
|
finally:
|
122
132
|
self._wip and self._wip.pop()
|
syncmodels/schema.py
CHANGED
syncmodels/session/__init__.py
CHANGED
@@ -278,20 +278,8 @@ class iSession(iContext, iSchema, iRegistry): # , iAuthenticator):
|
|
278
278
|
item = factory(bot=bot, *args, **uri)
|
279
279
|
return item
|
280
280
|
except Exception as why: # pragma: nocover
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
# option = cls.locate(url, __klass__=cls, score=score)
|
285
|
-
# if option:
|
286
|
-
# uri = parse_uri(url)
|
287
|
-
# factory, info = option
|
288
|
-
# for __key__, (args, kw) in info.items():
|
289
|
-
# try:
|
290
|
-
# context.update(kw)
|
291
|
-
# item = factory(bot=bot, *args, **uri, **context)
|
292
|
-
# return item
|
293
|
-
# except Exception as why:
|
294
|
-
# print(why)
|
281
|
+
log.error(why)
|
282
|
+
log.error("".join(traceback.format_exception(*sys.exc_info())))
|
295
283
|
|
296
284
|
raise RuntimeError(f"Unable to create a {cls} for url: {url}")
|
297
285
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: syncmodels
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.347
|
4
4
|
Summary: Synchronizable Models
|
5
5
|
Home-page: https://github.com/asterio.gonzalez/syncmodels
|
6
6
|
Author: Asterio Gonzalez
|
@@ -18,7 +18,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
18
18
|
Requires-Python: >=3.6
|
19
19
|
License-File: LICENSE
|
20
20
|
License-File: AUTHORS.rst
|
21
|
-
Requires-Dist: agptools>=0.1.
|
21
|
+
Requires-Dist: agptools>=0.1.347
|
22
22
|
Requires-Dist: aiocache
|
23
23
|
Requires-Dist: aiohttp
|
24
24
|
Requires-Dist: Click
|
@@ -1,4 +1,4 @@
|
|
1
|
-
syncmodels/__init__.py,sha256=
|
1
|
+
syncmodels/__init__.py,sha256=gzVDRfhD5jxqSmbFoEkH0JtQiWj1v0xeF8a7zDZx9pc,146
|
2
2
|
syncmodels/context.py,sha256=k1Gs_ip9BfyRFpyRnzqYvRDKo0sYBqJsh6z9sWln9oE,451
|
3
3
|
syncmodels/crawler.py,sha256=lx0IU586JD0qcdozWiv0y7970CkUEg3SzFB6gOYDS6I,94540
|
4
4
|
syncmodels/crud.py,sha256=oZIcwEKR2i-lesEF_059Y4yThohd9m7gs6R6xYgLH-I,15351
|
@@ -9,8 +9,8 @@ syncmodels/http.py,sha256=FFVT3QJJgur2dv1Q_7l9ZsWN8z6_gUjOT9hJff1ZAqk,3335
|
|
9
9
|
syncmodels/parallel.py,sha256=Ll8HmyFF9v9fIofqqSgfhyTlklvb77mTtNdG5Y9lqdQ,7145
|
10
10
|
syncmodels/registry.py,sha256=YaQtgbSwa0je1MpCcVHALI3_b85vrddyOlhsnrUcKZs,8224
|
11
11
|
syncmodels/requests.py,sha256=wWoC5hPDm1iBM_zrlyKRauzhXgdKR3pT5RqyC-5UZhQ,538
|
12
|
-
syncmodels/runner.py,sha256=
|
13
|
-
syncmodels/schema.py,sha256=
|
12
|
+
syncmodels/runner.py,sha256=Tb5KTu_XFxCphrtfcnmIqTItG91el7P-9B5WaDTMp18,5928
|
13
|
+
syncmodels/schema.py,sha256=HMr0LcB40se5sqHF4WYQIdzXUphLa2fhf0KFFUMzpDM,2726
|
14
14
|
syncmodels/storage.py,sha256=x01TmpETMrHvQvliL3TXfUp18RKr6Huz6DmrRZWD1DU,76418
|
15
15
|
syncmodels/syncmodels.py,sha256=jcUxVbv1hrx5hI81VCO1onIM6WyORTqJVPwIqlPocOc,10596
|
16
16
|
syncmodels/timequeue.py,sha256=YRd3ULRaIhoszaBsYhfr0epMqAbL6-NwVEtScjUYttM,595
|
@@ -297,16 +297,16 @@ syncmodels/model/schema_org/webpage.py,sha256=-bqKOpEs_2lW7qrey2nHtvOZ9xbmmwcviN
|
|
297
297
|
syncmodels/model/schema_org/webpageelement.py,sha256=brXfhU3l3FBXpy8qnR1Ve-EckjHW8VGoyR2IsnT7t2Y,1104
|
298
298
|
syncmodels/model/schema_org/website.py,sha256=48Rox27BbFIg1u3wDlOtX-lLCPoFgvvrCw5Hrdf6uRU,912
|
299
299
|
syncmodels/model/schema_org/xpathtype.py,sha256=D8gKiCrGSSuUVYw7BIWmOIUbKATfv2IpbkV1B2TmjC0,484
|
300
|
-
syncmodels/session/__init__.py,sha256=
|
300
|
+
syncmodels/session/__init__.py,sha256=89o6oeJsUaaiZENZDYJ2lP2PQBWX6OZPIzQacWjNh2k,15606
|
301
301
|
syncmodels/session/http.py,sha256=tf7z0ccAEYoCOZT4Ukv3NBXz9hUO3vs2s9bm491pCj8,1480
|
302
302
|
syncmodels/session/postgresql.py,sha256=ZMIu1Rv93pKfvFlovFBmWArzlrT2xaQWNYGZT_LW61k,175
|
303
303
|
syncmodels/session/sql.py,sha256=auZ_3RZTSWViED4UrExYaes42Y2bTZKixEsfOpa_zaU,7036
|
304
304
|
syncmodels/session/sqlite.py,sha256=nCDjopLiBpX1F10qkKoARM7JrVdIpJ1WdGOduFVxaiA,2080
|
305
305
|
syncmodels/source/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
306
|
-
syncmodels-0.1.
|
307
|
-
syncmodels-0.1.
|
308
|
-
syncmodels-0.1.
|
309
|
-
syncmodels-0.1.
|
310
|
-
syncmodels-0.1.
|
311
|
-
syncmodels-0.1.
|
312
|
-
syncmodels-0.1.
|
306
|
+
syncmodels-0.1.347.dist-info/AUTHORS.rst,sha256=3ZPoqg8Aav8DSYKd0fwcwn4_5HwSiMLart0E5Un00-U,168
|
307
|
+
syncmodels-0.1.347.dist-info/LICENSE,sha256=uzMOYtIiUsnsD0xHJR7aJWJ4v_bvan0kTnvufy5eNoA,1075
|
308
|
+
syncmodels-0.1.347.dist-info/METADATA,sha256=6DDbCRO4MbKxyD95HpFrpPkTwQm_THh6vdJ7HPTWr3E,2700
|
309
|
+
syncmodels-0.1.347.dist-info/WHEEL,sha256=SrDKpSbFN1G94qcmBqS9nyHcDMp9cUS9OC06hC0G3G0,109
|
310
|
+
syncmodels-0.1.347.dist-info/entry_points.txt,sha256=dMnigjZsHMxTwXiiZyBZdBbMYE0-hY3L5cG15EcDAzw,51
|
311
|
+
syncmodels-0.1.347.dist-info/top_level.txt,sha256=2DfQ9NuAhKMjY3BvQGVBA7GfqTm7EoHNbaehSUiqiHQ,11
|
312
|
+
syncmodels-0.1.347.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|