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

move repo.updatestamp update from Upload to UploadFinisher #828

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion tasks/tests/unit/test_upload_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ def test_upload_task_call(
assert commit.parent_commit_id is None
assert commit.report is not None
assert commit.report.details is not None
assert commit.repository.updatestamp > repo_updatestamp
sessions = commit.report.uploads
assert len(sessions) == 1
first_session = (
Expand Down
2 changes: 0 additions & 2 deletions tasks/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import time
import uuid
from copy import deepcopy
from datetime import datetime
from typing import Any, Dict, List, Optional

import orjson
Expand Down Expand Up @@ -416,7 +415,6 @@ def run_impl_within_lock(
)
assert commit, "Commit not found in database."
repository = commit.repository
repository.updatestamp = datetime.now()
repository_service = None

was_updated, was_setup = False, False
Expand Down
5 changes: 5 additions & 0 deletions tasks/upload_finisher.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging
import random
import re
from datetime import datetime
from enum import Enum

import sentry_sdk
Expand Down Expand Up @@ -163,6 +164,10 @@ def run_impl(

cleanup_intermediate_reports(archive_service, commit.commitid, upload_ids)

# Mark the repository as updated so it will appear earlier in the list
# of recently-active repositories
repository.updatestamp = datetime.now()

if not should_trigger_postprocessing(state.get_upload_numbers()):
return

Expand Down
Loading