Skip to content

Commit

Permalink
Merge pull request #5 from magro/shutdown-cluster
Browse files Browse the repository at this point in the history
Shutdown cluster in migrate & initialize
  • Loading branch information
pvenable committed Mar 25, 2014
2 parents cf0e20b + 0bf5af2 commit abe7950
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/scala/com/streamsend/pillar/CassandraMigrator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class CassandraMigrator(registry: Registry) extends Migrator {

selectMigrationsToReverse(dateRestriction, appliedMigrations).foreach(_.executeDownStatement(session))
selectMigrationsToApply(dateRestriction, appliedMigrations).foreach(_.executeUpStatement(session))

cluster.close
}

def initialize(dataStore: DataStore, replicationOptions: ReplicationOptions = ReplicationOptions.default) {
Expand All @@ -28,6 +30,7 @@ class CassandraMigrator(registry: Registry) extends Migrator {
| )
""".stripMargin.format(dataStore.keyspace)
)
cluster.close
}

private def executeIdempotentCommand(session: Session, statement: String) {
Expand Down

0 comments on commit abe7950

Please sign in to comment.