1
0
Fork 0

Merge pull request #1099 from rqlite/cli-exit-support

Explicitly support .exit in CLI
master
Philip O'Toole 2 years ago committed by GitHub
commit 71ebd496d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,6 +3,7 @@
### Implementation changes and bug fixes
- [PR #1097](https://github.com/rqlite/rqlite/pull/1097): Start HTTP server as soon as possible after launch.
- [PR #1098](https://github.com/rqlite/rqlite/pull/1098): Bootstrapper doesn't need to know the bootstrap-expect value.
- [PR #1099](https://github.com/rqlite/rqlite/pull/1099): Add explicit `.exit` option to CLI.
## 7.10.0 (October 26th 2022)
### New features

@ -40,6 +40,7 @@ var cliHelp = []string{
`.backup <file> Write database backup to SQLite file`,
`.consistency [none|weak|strong] Show or set read consistency level`,
`.dump <file> Dump the database in SQL text format to a file`,
`.exit Exit this program`,
`.expvar Show expvar (Go runtime) information for connected node`,
`.help Show this message`,
`.indexes Show names of all indexes`,
@ -173,7 +174,7 @@ func main() {
err = dump(ctx, line[index+1:], argv)
case ".HELP":
err = help(ctx, cmd, line, argv)
case ".QUIT", "QUIT", "EXIT":
case ".QUIT", "QUIT", "EXIT", ".EXIT":
break FOR_READ
case "SELECT", "PRAGMA":
err = queryWithClient(ctx, client, timer, consistency, line)

@ -262,6 +262,7 @@ class Node(object):
t = 0
while wait:
if t > timeout:
self.dump_log("dumping log due to timeout during start")
raise Exception('rqlite process failed to start within %d seconds' % timeout)
try:
self.status()
@ -511,6 +512,13 @@ class Node(object):
f.write(json.dumps(peers))
f.close()
def dump_log(self, msg):
print(msg)
self.stderr_fd.close()
f = open(self.stderr_file, 'r')
for l in f.readlines():
print(l.strip())
def _status_url(self):
return 'http://' + self.APIAddr() + '/status'
def _nodes_url(self):

Loading…
Cancel
Save