# flush usd folders to exclude from syncshots_dir="//depot/Jobs/Content/Jobs/shots"subprocess.run(['p4','flush','-q',f'{shots_dir}/.../usd/...'],check=False,)# reconcile sync folders with current task foldertask_type=self.data["workdir_data"]["task"]["type"].lower()workdir_path=self.data["workdir_data"]["folder"]["path"]shot_match=re.match(r"\/shots\/episodes\/(?P<ep>[a-z0-9]+)"r"(?P<sq>\/[a-z0-9]+)?"r"(?P<sh>\/[a-z0-9]+)?.*",workdir_path,)ifshot_matchandtask_typein("lighting","render"):shot_data=shot_match.groupdict()ep_name=shot_data.get("ep").upper()sq_name=(shot_data.get("sq")or"").upper()sh_name=(shot_data.get("sh")or"").upper()wildcard="/usd/..."ifsh_nameelse"/.../usd/..."usd_files=f'{shots_dir}/{ep_name}{sq_name}{sh_name}{wildcard}'self.log.info(usd_files)subprocess.run(['p4','-I','clean',usd_files],check=False)
Hard code dans [ayon-perforce-loops](https://github.com/LoopsCreativeStudio/ayon-perforce-loops)
```python
# flush usd folders to exclude from sync
shots_dir = "//depot/Jobs/Content/Jobs/shots"
subprocess.run(
['p4', 'flush', '-q', f'{shots_dir}/.../usd/...'], check=False,
)
# reconcile sync folders with current task folder
task_type = self.data["workdir_data"]["task"]["type"].lower()
workdir_path = self.data["workdir_data"]["folder"]["path"]
shot_match = re.match(
r"\/shots\/episodes\/(?P<ep>[a-z0-9]+)"
r"(?P<sq>\/[a-z0-9]+)?"
r"(?P<sh>\/[a-z0-9]+)?.*",
workdir_path,
)
if shot_match and task_type in ("lighting","render"):
shot_data = shot_match.groupdict()
ep_name = shot_data.get("ep").upper()
sq_name = (shot_data.get("sq") or "").upper()
sh_name = (shot_data.get("sh") or "").upper()
wildcard = "/usd/..." if sh_name else "/.../usd/..."
usd_files = f'{shots_dir}/{ep_name}{sq_name}{sh_name}{wildcard}'
self.log.info(usd_files)
subprocess.run(['p4', '-I', 'clean', usd_files], check=False)
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
On ayon_server :
Add settings rules for sync :
Hard code dans ayon-perforce-loops