code: def shutdownFileStore(workflowDir, workflowID):
      
      cacheDir = os.path.join(workflowDir, cacheDirName(workflowID))
      if os.path.exists(cacheDir):
          # The presence of the cacheDir suggests this was a cached run. We don't need the cache lock
          # for any of this since this is the final cleanup of a job and there should be  no other
          # conflicting processes using the cache.
          CachingFileStore.shutdown(cacheDir)
      else:
          # This absence of cacheDir suggests otherwise.
          NonCachingFileStore.shutdown(workflowDir)
docs: Run the deferred functions from any prematurely terminated jobs still lingering on the system
      and carry out any necessary filestore-specific cleanup.
  
      This is a destructive operation and it is important to ensure that there are no other running
      processes on the system that are modifying or using the file store for this workflow.
  
  
      This is the intended to be the last call to the file store in a Toil run, called by the
      batch system cleanup function upon batch system shutdown.
  
      :param str workflowDir: The path to the cache directory
      :param str workflowID: The workflow ID for this invocation of the workflow