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):
630630 pass
631631
632632 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+ """
634637 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." )
639639 if self .status .stage == WorkStageStatus .STOPPED :
640640 return
641641 latest_hash = self ._calls [CacheCallsKeys .LATEST_CALL_HASH ]
You can’t perform that action at this time.
0 commit comments