Skip to content

Reload issues #4

@tingstad

Description

@tingstad

I have observed two potential issues:

1. reload duplication

Sometimes when changing a file I see several lines of Successfully reloaded. For example when I run touch file. I suspect this is because touch (and other operations?) are not atomic. Maybe only small modules are reloaded multiple times, and performance heavy modules only have time for one reload? May thus not be a real problem. (A possible solution could be some kind of debounce, but that would also limit hotload speed?)

2. reload crash

Some editors make the hotloader crash. For example running echo lib.py | python hotload.py lib.py works fine for some editors, but when editing lib.py in Vim om my mac I get:

  File "/Users/richard/dev/hotload/hotload.py", line 43, in _file_changed
    return os.stat(f).st_mtime
FileNotFoundError: [Errno 2] No such file or directory: '/Users/richard/dev/hotload/lib.py'

Again, I suspect that Vim does something non-atomic on save.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions