Skip to content

Commit

Permalink
fix: RND-120: Redis storage doesn't have db field and redis target mi…
Browse files Browse the repository at this point in the history
…sses validation_connection() (#6255)
  • Loading branch information
makseq authored Aug 26, 2024
1 parent 9663da0 commit 97c881d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions label_studio/io_storages/redis/form_layout.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ redis_title: &redis_title

# 2x2 grid
redis_params: &redis_params
- type: text
name: db
label: Database Number (db)
placeholder: 1
- type: text
name: path
label: Path
Expand Down
5 changes: 5 additions & 0 deletions label_studio/io_storages/redis/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ def save_annotation(self, annotation):
# create link if everything ok
RedisExportStorageLink.create(annotation, self)

def validate_connection(self, client=None):
if client is None:
client = self.get_client()
client.ping()


@receiver(post_save, sender=Annotation)
def export_annotation_to_redis_storages(sender, instance, **kwargs):
Expand Down

0 comments on commit 97c881d

Please sign in to comment.