Skip to content

Commit

Permalink
fix the repo always directing db to bb-events
Browse files Browse the repository at this point in the history
  • Loading branch information
lgflorentino committed Oct 14, 2024
1 parent 8f53062 commit 4feece6
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
4 changes: 3 additions & 1 deletion lib/activity_monitor/db/repos/cb_repo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ module Repos

# Service repo for the Codeberg service.
class CBRepo < ROM::Repository[:cb_events]


commands :create

end
end
end
Expand Down
2 changes: 2 additions & 0 deletions lib/activity_monitor/db/repos/gh_repo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ module Repos

# Service repo for the Github service.
class GHRepo < ROM::Repository[:gh_events]

commands :create

end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/activity_monitor/db/repos/gl_repo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module DB
module Repos
# Service repo for the Gitlab service.
class GLRepo < ROM::Repository[:gl_events]

commands :create
end
end
end
Expand Down
1 change: 1 addition & 0 deletions lib/activity_monitor/db/repos/sh_repo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module DB
module Repos
# Service repo for the Source Hut service.
class SHRepo < ROM::Repository[:sh_events]
commands :create
end
end
end
Expand Down
1 change: 1 addition & 0 deletions lib/activity_monitor/routing/default_router.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def match_request(*args, **kws)
slug_re = %r{^*/#{route[1]}/*}
if slug_re.match?(path_info)
resp = process_request(route[0], env: args[0])
log.debug "Matched request: #{route[0]} with #{path_info}"
break
end
end
Expand Down
3 changes: 1 addition & 2 deletions lib/activity_monitor/services/bitbucket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
module ActivityMonitor
module Services
class Bitbucket < ActivityMonitor::Services::Service
NAME = Bitbucket

def initialize
super
@service_name = "bitbucket"
end
end
end
Expand Down
5 changes: 2 additions & 3 deletions lib/activity_monitor/services/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ module Services
class Service
include ActivityMonitor::Logging

SERVICE_NAME = "super"

def initialize()
@service_name = "default"
end

def call(*args, **kws, &blk); end

def db_setup(db: nil)
@repo = DB::Repos::BBRepo.new(db)
@repo = DB::Repos.init_repo(service_name: @service_name, db: db)
end

def process_event(content)
Expand Down

0 comments on commit 4feece6

Please sign in to comment.