File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -630,12 +630,12 @@ def on_exit(self):
630
630
pass
631
631
632
632
def stop (self ):
633
- """Stops LightingWork component and shuts down hardware provisioned via L.CloudCompute."""
633
+ """Stops LightingWork component and shuts down hardware provisioned via L.CloudCompute.
634
+
635
+ This can only be called from a ``LightningFlow``.
636
+ """
634
637
if not self ._backend :
635
- raise Exception (
636
- "Can't stop the work, it looks like it isn't attached to a LightningFlow. "
637
- "Make sure to assign the Work to a flow instance."
638
- )
638
+ raise RuntimeError (f"Only the `LightningFlow` can request this work ({ self .name !r} ) to stop." )
639
639
if self .status .stage == WorkStageStatus .STOPPED :
640
640
return
641
641
latest_hash = self ._calls [CacheCallsKeys .LATEST_CALL_HASH ]
You can’t perform that action at this time.
0 commit comments