mirror of
https://github.com/pgsty/minio.git
synced 2026-07-20 12:40:24 +03:00
Enhance the event store interface to support channeling (#7343)
- Avoids code duplication across the other targets. By having a centralized function call. - Reduce the room for race.
This commit is contained in:
committed by
Nitish Tiwari
parent
ddb0d646aa
commit
47ca411163
@@ -140,8 +140,12 @@ func (target *PostgreSQLTarget) ID() event.TargetID {
|
||||
return target.id
|
||||
}
|
||||
|
||||
// Send - sends event to PostgreSQL.
|
||||
func (target *PostgreSQLTarget) Send(eventData event.Event) error {
|
||||
// Save - Sends event directly without persisting.
|
||||
func (target *PostgreSQLTarget) Save(eventData event.Event) error {
|
||||
return target.send(eventData)
|
||||
}
|
||||
|
||||
func (target *PostgreSQLTarget) send(eventData event.Event) error {
|
||||
if target.args.Format == event.NamespaceFormat {
|
||||
objectName, err := url.QueryUnescape(eventData.S3.Object.Key)
|
||||
if err != nil {
|
||||
@@ -180,6 +184,11 @@ func (target *PostgreSQLTarget) Send(eventData event.Event) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Send - interface compatible method does no-op.
|
||||
func (target *PostgreSQLTarget) Send(eventKey string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Close - closes underneath connections to PostgreSQL database.
|
||||
func (target *PostgreSQLTarget) Close() error {
|
||||
if target.updateStmt != nil {
|
||||
|
||||
Reference in New Issue
Block a user