Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update product file with time of last write, when using option 'use_tmp_file = True' (touch) #78

Open
Weathermann opened this issue Apr 30, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@Weathermann
Copy link

... like Linux touch command

When using use_tmp_file = True in trollflow2 yaml products will be created with a tempfile. The duration of the begin of creating the file and finish writing can be a relatively long period of time; up to 20 minutes (NOAA-20, S-NPP).

In DWD we use a file distribution system, which distribute new files to a number of customers. Only new products should be distributed. We recognize new files by the modification time by using the find command (e.g. -mmin 1).

The finished product will have the timestamp of file creation.
So with long creation durations the distribution program doesn't recognize such products as new files any more and there will be no distribution to our customers.

What I want to achive is a behaviour like the touch command in Linux.
And indeed, there is Python function in the relatively new Pathlib called touch() (https://docs.python.org/3/library/pathlib.html?highlight=touch#pathlib.Path.touch).

After the file is completely written, the file mtime should be updated, to indicate, that it is a new file.

I suppose there is no compatibilty break with this feature.

Example, where to implement:
... /venv-p3/lib/python3.6/site-packages/trollflow2/plugins/init.py

line 25: from Pathlib import Path
line 219: Path(tmp_name).touch()
@pnuu pnuu added the enhancement New feature or request label Apr 30, 2020
@Weathermann
Copy link
Author

  1. I forked trollflow2
  2. made changes to __init__.py

=> https://github.com/Weathermann/trollflow2/pulls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants