Skip to content

Commit

Permalink
Fixed cleaning operation storage when using sync mode and forking (#1413
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Raalsky authored Aug 4, 2023
1 parent 76dcb5e commit d48d235
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Fixes
- Load CLI plug-ins in try..except block to avoid a failure in loading a plug-in to crash entire CLI ([#1392](https://github.com/neptune-ai/neptune-client/pull/1392))
- Fixed cleaning operation storage when using sync mode and forking ([#1413](https://github.com/neptune-ai/neptune-client/pull/1413))


## neptune 1.4.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#
__all__ = ("SyncOperationProcessor",)

import os
from datetime import datetime
from pathlib import Path
from typing import Optional
Expand Down Expand Up @@ -42,7 +43,7 @@ def __init__(self, container_id: UniqueId, container_type: ContainerType, backen
def _init_data_path(container_id: UniqueId, container_type: ContainerType) -> Path:
now = datetime.now()
container_dir = f"{NEPTUNE_DATA_DIRECTORY}/{SYNC_DIRECTORY}/{container_type.create_dir_name(container_id)}"
data_path = f"{container_dir}/exec-{now.timestamp()}-{now.strftime('%Y-%m-%d_%H.%M.%S.%f')}"
data_path = f"{container_dir}/exec-{now.timestamp()}-{now.strftime('%Y-%m-%d_%H.%M.%S.%f')}-{os.getpid()}"
return Path(data_path)

def enqueue_operation(self, op: Operation, *, wait: bool) -> None:
Expand All @@ -66,3 +67,6 @@ def start(self):

def stop(self, seconds: Optional[float] = None):
self._operation_storage.close()

def close(self):
pass

0 comments on commit d48d235

Please sign in to comment.