From 2a75a36b275ea7f47a95ad2efc70be22d5ed3fe2 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 8 Jan 2019 20:26:19 -0800 Subject: [PATCH] set cassandra ttl with entry.TTLSec --- weed/filer2/cassandra/cassandra_store.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/filer2/cassandra/cassandra_store.go b/weed/filer2/cassandra/cassandra_store.go index e8f51dd04..2c1f03182 100644 --- a/weed/filer2/cassandra/cassandra_store.go +++ b/weed/filer2/cassandra/cassandra_store.go @@ -48,8 +48,8 @@ func (store *CassandraStore) InsertEntry(entry *filer2.Entry) (err error) { } if err := store.session.Query( - "INSERT INTO filemeta (directory,name,meta) VALUES(?,?,?)", - dir, name, meta).Exec(); err != nil { + "INSERT INTO filemeta (directory,name,meta) VALUES(?,?,?) USING TTL ? ", + dir, name, meta, entry.TtlSec).Exec(); err != nil { return fmt.Errorf("insert %s: %s", entry.FullPath, err) }