File size: 745 Bytes
f624d68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""
Refreshes the `files` and `reconstructions` tables for a single repo.
"""

import sys

import list_files
import list_reconstructions
import list_repos

def refresh_oldest_repo():
    oldest_repo = list_repos.list_repos(limit=1)
    assert(len(oldest_repo) == 1)
    refresh_repo(oldest_repo[0])

def refresh_repo(repo):
    print("Refreshing repo", repo, file=sys.stderr)
    print("Listing files", file=sys.stderr)
    list_files.write_files_to_db(repo)
    print("Listing reconstructions", file=sys.stderr)
    list_reconstructions.write_files_to_db(repo)
    print("Updating timestamp", file=sys.stderr)
    list_repos.set_updated_datetime(repo)
    print("Done", file=sys.stderr)
    
if __name__ == "__main__":
    refresh_oldest_repo()