From 7dc7b9c2c2d4b169ad545606e2fc7ef752a5d5a2 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Tue, 23 Aug 2022 11:39:32 +0200 Subject: update repository last refreshal time upon refreshing --- src/hydrilla/proxy/state_impl/repos.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/hydrilla') diff --git a/src/hydrilla/proxy/state_impl/repos.py b/src/hydrilla/proxy/state_impl/repos.py index 663a450..ae3b70c 100644 --- a/src/hydrilla/proxy/state_impl/repos.py +++ b/src/hydrilla/proxy/state_impl/repos.py @@ -240,7 +240,7 @@ class ConcreteRepoRef(st.RepoRef): ensure_repo_not_deleted(cursor, self.id) cursor.execute( - 'SELECT url from repos where repo_id = ?;', + 'SELECT url FROM repos WHERE repo_id = ?;', (self.id,) ) @@ -258,6 +258,18 @@ class ConcreteRepoRef(st.RepoRef): self.state.recompute_dependencies() + cursor.execute( + ''' + UPDATE + repos + SET + last_refreshed = STRFTIME('%s', 'NOW') + WHERE + repo_id = ?; + ''', + (self.id,) + ) + return ConcreteRepoIterationRef(str(new_iteration_id), self.state) def get_display_info(self) -> st.RepoDisplayInfo: -- cgit v1.2.3