diff --git a/label_studio/io_storages/redis/form_layout.yml b/label_studio/io_storages/redis/form_layout.yml index 14a669908aa3..979ca037966a 100644 --- a/label_studio/io_storages/redis/form_layout.yml +++ b/label_studio/io_storages/redis/form_layout.yml @@ -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 diff --git a/label_studio/io_storages/redis/models.py b/label_studio/io_storages/redis/models.py index 0c1eba4663fa..96c3d7ef93cd 100644 --- a/label_studio/io_storages/redis/models.py +++ b/label_studio/io_storages/redis/models.py @@ -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):