Refactor services to extend BaseService for improved structure and dependency management
- Update AuthService and RelayHub to extend BaseService, introducing standardized initialization and metadata handling. - Implement service-specific initialization methods in both services, enhancing error handling and logging. - Modify NostrmarketService to inherit from BaseService, ensuring consistent dependency management and initialization. - Refactor market module to dynamically import NostrmarketService, improving service registration and initialization flow. - Enhance debug logging across services for better traceability during initialization and operation.
This commit is contained in:
parent
8d4c389f71
commit
dc4da570a7
5 changed files with 151 additions and 50 deletions
|
|
@ -33,7 +33,10 @@ export const baseModule: ModulePlugin = {
|
|||
|
||||
// Initialize core services
|
||||
await relayHub.initialize(options?.config?.nostr?.relays || [])
|
||||
await auth.initialize()
|
||||
await auth.initialize({
|
||||
waitForDependencies: false, // Auth has no dependencies
|
||||
maxRetries: 1
|
||||
})
|
||||
|
||||
console.log('✅ Base module installed successfully')
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue