Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion fns_cli/file_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

import asyncio
import logging
import os
import uuid
Expand Down Expand Up @@ -203,6 +204,7 @@ async def _on_sync_update(self, msg: WSMessage) -> None:
except Exception:
log.exception("Failed to write file %s", rel_path)
finally:
await asyncio.sleep(0.6)
self.engine.unignore_file(rel_path)

self._received_modify += 1
Expand Down Expand Up @@ -232,6 +234,7 @@ async def _on_sync_delete(self, msg: WSMessage) -> None:
except Exception:
log.exception("Failed to delete file %s", rel_path)
finally:
await asyncio.sleep(0.6)
self.engine.unignore_file(rel_path)

self._received_delete += 1
Expand All @@ -256,6 +259,7 @@ async def _on_sync_rename(self, msg: WSMessage) -> None:
except Exception:
log.exception("Failed to rename file %s → %s", old_path, new_path)
finally:
await asyncio.sleep(0.6)
self.engine.unignore_file(old_path)
self.engine.unignore_file(new_path)

Expand Down Expand Up @@ -315,8 +319,9 @@ async def _finalize_download(self, session_id: str, session: _DownloadSession) -
except Exception:
log.exception("Failed to write downloaded file %s", rel_path)
finally:
self.engine.unignore_file(rel_path)
self._download_sessions.pop(session_id, None)
await asyncio.sleep(0.6)
self.engine.unignore_file(rel_path)

async def _on_sync_end(self, msg: WSMessage) -> None:
data = _extract_inner(msg.data)
Expand Down
3 changes: 3 additions & 0 deletions fns_cli/note_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

import asyncio
import logging
import os
import uuid
Expand Down Expand Up @@ -147,6 +148,7 @@ async def _on_sync_modify(self, msg: WSMessage) -> None:
except Exception:
log.exception("Failed to write %s", rel_path)
finally:
await asyncio.sleep(0.6)
self.engine.unignore_file(rel_path)

self._received_modify += 1
Expand All @@ -167,6 +169,7 @@ async def _on_sync_delete(self, msg: WSMessage) -> None:
except Exception:
log.exception("Failed to delete %s", rel_path)
finally:
await asyncio.sleep(0.6)
self.engine.unignore_file(rel_path)

self._received_delete += 1
Expand Down
Loading