Fix commit times

This commit is contained in:
Mahad Kalam 2026-02-08 22:15:47 +00:00
parent 2e0f128946
commit f73d268d42
2 changed files with 13 additions and 8 deletions

View file

@ -11,9 +11,14 @@ class SyncRepoMetadataJob < ApplicationJob
Rails.logger.info "[SyncRepoMetadataJob] Syncing metadata for #{repository.url}"
begin
# Use any user who has mapped to this repository for API access
user = repository.users.joins(:project_repo_mappings).first
return unless user
user = repository.users
.joins(:project_repo_mappings)
.where.not(github_access_token: [ nil, "" ])
.first
unless user
Rails.logger.warn "[SyncRepoMetadataJob] No user with GitHub token available for #{repository.url}"
return
end
service = RepoHost::ServiceFactory.for_url(user, repository.url)
metadata = service.fetch_repo_metadata

View file

@ -123,12 +123,12 @@ Rails.application.configure do
cron: "0 2 * * *",
class: "ProcessAccountDeletionsJob",
description: "nuke accounts after 30 days"
},
sync_stale_repo_metadata: {
cron: "0 4 * * *", # Daily at 4 AM
class: "SyncStaleRepoMetadataJob",
description: "Refreshes repository metadata (stars, commit counts, etc.) for repositories with stale data."
}
# sync_stale_repo_metadata: {
# cron: "0 4 * * *", # Daily at 4 AM
# class: "SyncStaleRepoMetadataJob",
# description: "Refreshes repository metadata (stars, commit counts, etc.) for repositories with stale data."
# },
# cleanup_old_leaderboards: {
# cron: "0 3 * * *", # daily at 3
# class: "CleanupOldLeaderboardsJob",