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

[BUG] don't use tmp file when the migration is very long #63

Closed
fmdl opened this issue Mar 26, 2024 · 1 comment
Closed

[BUG] don't use tmp file when the migration is very long #63

fmdl opened this issue Mar 26, 2024 · 1 comment

Comments

@fmdl
Copy link

fmdl commented Mar 26, 2024

Steps to reproduce:
On server start a migration with python <(curl -s https://upgrade.odoo.com/upgrade) test -d
some file is create in tmp
--> if the migration take lot of time (24 hour), files in tmp are delete by the system (or if server are rebooted). without file it is not possible to resume the migration.

patch : use a normal directory

def gettempdir():
    dir = os.path.join(os.path.expanduser('~'), '.upgrade')
    if not os.path.exists(dir):
        os.makedirs(dir)
    return dir

tempfile.gettempdir = gettempdir
@aj-fuentes
Copy link
Contributor

The behavior is intended.

Solution:

$ mkdir ~/.upgrade
$ TMP=~/.upgrade python <(curl -s https://upgrade.odoo.com/upgrade) test -d

https://docs.python.org/3/library/tempfile.html#tempfile.gettempdir

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

No branches or pull requests

2 participants