apify 2.3.0b1__py3-none-any.whl → 2.3.0b3__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.
Potentially problematic release.
This version of apify might be problematic. Click here for more details.
apify/_actor.py
CHANGED
|
@@ -55,10 +55,8 @@ MainReturnType = TypeVar('MainReturnType')
|
|
|
55
55
|
class _ActorType:
|
|
56
56
|
"""The class of `Actor`. Only make a new instance if you're absolutely sure you need to."""
|
|
57
57
|
|
|
58
|
-
_apify_client: ApifyClientAsync
|
|
59
|
-
_configuration: Configuration
|
|
60
|
-
_is_exiting = False
|
|
61
58
|
_is_rebooting = False
|
|
59
|
+
_is_any_instance_initialized = False
|
|
62
60
|
|
|
63
61
|
def __init__(
|
|
64
62
|
self,
|
|
@@ -76,6 +74,8 @@ class _ActorType:
|
|
|
76
74
|
be created.
|
|
77
75
|
configure_logging: Should the default logging configuration be configured?
|
|
78
76
|
"""
|
|
77
|
+
self._is_exiting = False
|
|
78
|
+
|
|
79
79
|
self._configuration = configuration or Configuration.get_global_configuration()
|
|
80
80
|
self._configure_logging = configure_logging
|
|
81
81
|
self._apify_client = self.new_client()
|
|
@@ -200,6 +200,12 @@ class _ActorType:
|
|
|
200
200
|
if self._is_initialized:
|
|
201
201
|
raise RuntimeError('The Actor was already initialized!')
|
|
202
202
|
|
|
203
|
+
if _ActorType._is_any_instance_initialized:
|
|
204
|
+
self.log.warning('Repeated Actor initialization detected - this is non-standard usage, proceed with care')
|
|
205
|
+
|
|
206
|
+
# Make sure that the currently initialized instance is also available through the global `Actor` proxy
|
|
207
|
+
cast(Proxy, Actor).__wrapped__ = self
|
|
208
|
+
|
|
203
209
|
self._is_exiting = False
|
|
204
210
|
self._was_final_persist_state_emitted = False
|
|
205
211
|
|
|
@@ -223,6 +229,7 @@ class _ActorType:
|
|
|
223
229
|
await self._event_manager.__aenter__()
|
|
224
230
|
|
|
225
231
|
self._is_initialized = True
|
|
232
|
+
_ActorType._is_any_instance_initialized = True
|
|
226
233
|
|
|
227
234
|
async def exit(
|
|
228
235
|
self,
|
|
@@ -898,11 +905,11 @@ class _ActorType:
|
|
|
898
905
|
self.log.error('Actor.reboot() is only supported when running on the Apify platform.')
|
|
899
906
|
return
|
|
900
907
|
|
|
901
|
-
if
|
|
908
|
+
if _ActorType._is_rebooting:
|
|
902
909
|
self.log.debug('Actor is already rebooting, skipping the additional reboot call.')
|
|
903
910
|
return
|
|
904
911
|
|
|
905
|
-
|
|
912
|
+
_ActorType._is_rebooting = True
|
|
906
913
|
|
|
907
914
|
if not custom_after_sleep:
|
|
908
915
|
custom_after_sleep = self._configuration.metamorph_after_sleep
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
apify/__init__.py,sha256=HpgKg2FZWJuSPfDygzJ62psylhw4NN4tKFnoYUIhcd4,838
|
|
2
|
-
apify/_actor.py,sha256=
|
|
2
|
+
apify/_actor.py,sha256=gZVbubkFFaNVcEoU_343Cmlc4Svtxd5x9J1WhWZcE4o,46507
|
|
3
3
|
apify/_configuration.py,sha256=T3Z_o_W98iSyTbrutfb578yW51aexZ_V0FcLwTxFLjI,10878
|
|
4
4
|
apify/_consts.py,sha256=_Xq4hOfOA1iZ3n1P967YWdyncKivpbX6RTlp_qanUoE,330
|
|
5
5
|
apify/_crypto.py,sha256=e0_aM3l9_5Osk-jszYOOjrAKK60OggSHbiw5c30QnsU,5638
|
|
@@ -35,7 +35,7 @@ apify/scrapy/utils.py,sha256=5cka33PWc_at14yjhnLkCvY4h-ySUgVVhhDLxTy39ZI,1965
|
|
|
35
35
|
apify/storages/__init__.py,sha256=FW-z6ubuPnHGM-Wp15T8mR5q6lnpDGrCW-IkgZd5L30,177
|
|
36
36
|
apify/storages/_request_list.py,sha256=-lZJcE5nq69aJhGFJ7Sh2ctqgAWUDyOwYm5_0y1hdAE,5865
|
|
37
37
|
apify/storages/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
|
-
apify-2.3.
|
|
39
|
-
apify-2.3.
|
|
40
|
-
apify-2.3.
|
|
41
|
-
apify-2.3.
|
|
38
|
+
apify-2.3.0b3.dist-info/LICENSE,sha256=AsFjHssKjj4LGd2ZCqXn6FBzMqcWdjQre1byPPSypVw,11355
|
|
39
|
+
apify-2.3.0b3.dist-info/METADATA,sha256=OKMDpMZDy2GEMS3EfHZEL84Y3KlD7IXxmY-iyZIXVOo,8696
|
|
40
|
+
apify-2.3.0b3.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
41
|
+
apify-2.3.0b3.dist-info/RECORD,,
|
|
File without changes
|