@@ -102,12 +102,6 @@ export class Database {
102
102
} , 0 ) ;
103
103
} ;
104
104
105
- // Helper function to forcibly acquire a lock for a specific schema
106
- const forciblyAcquireLockForSchema = async ( lockId : number ) => {
107
- // This will block until the lock is acquired
108
- await client . query ( `SELECT pg_advisory_lock(${ lockId } )` ) ;
109
- } ;
110
-
111
105
// Helper function to acquire a lock for a specific schema
112
106
const acquireLockForSchema = async ( lockId : number ) => {
113
107
const result = await client . query (
@@ -124,8 +118,6 @@ export class Database {
124
118
125
119
// Acquire locks for all schemas
126
120
const chainDataLockId = generateLockId ( this . chainDataSchemaName ) ;
127
- // const ipfsDataLockId = generateLockId(this.ipfsDataSchemaName);
128
- // const priceDataLockId = generateLockId(this.priceDataSchemaName);
129
121
130
122
// Track acquired locks
131
123
const acquiredLocks : number [ ] = [ ] ;
@@ -134,22 +126,9 @@ export class Database {
134
126
const chainDataLockAcquired = await acquireLockForSchema ( chainDataLockId ) ;
135
127
if ( chainDataLockAcquired ) acquiredLocks . push ( chainDataLockId ) ;
136
128
137
- // const ipfsDataLockAcquired = await acquireLockForSchema(ipfsDataLockId);
138
- // if (ipfsDataLockAcquired) acquiredLocks.push(ipfsDataLockId);
139
- // const priceDataLockAcquired = await acquireLockForSchema(priceDataLockId);
140
- // if (priceDataLockAcquired) acquiredLocks.push(priceDataLockId);
141
-
142
- // NOTE: We are forcibly acquiring locks for IPFS and Price data schemas
143
- // await forciblyAcquireLockForSchema(ipfsDataLockId);
144
- // await forciblyAcquireLockForSchema(priceDataLockId);
145
- // acquiredLocks.push(ipfsDataLockId);
146
- // acquiredLocks.push(priceDataLockId);
147
-
148
129
this . #logger. info ( `Lock Status =>
149
130
Chain Data (${ chainDataLockId } ): ${ chainDataLockAcquired }
150
131
` ) ;
151
- // IPFS Data (${ipfsDataLockId}): ${ipfsDataLockAcquired},
152
- // Price Data (${priceDataLockId}): ${priceDataLockAcquired}
153
132
154
133
return {
155
134
release : async ( ) => {
0 commit comments