コード例 #1
0
 def test_import_db_dump(self):
     id1 = dump._create_new_inc_dump_record()[0]
     path = dump.dump_db(self.temp_dir)
     self.reset_db()
     dump.import_db_dump(path, _TABLES)
     self.assertEqual(dump.list_incremental_dumps()[0][0], id1)
     id2 = dump._create_new_inc_dump_record()[0]
     self.assertGreater(id2, id1)
コード例 #2
0
def full_db(location, threads, rotate):
    print("Creating full database dump...")
    path = dump.dump_db(location, threads)
    print("Done! Created:", path)

    if rotate:
        print("Removing old dumps (except two latest)...")
        remove_old_archives(location, "acousticbrainz-dump-[0-9]+-[0-9]+.tar.xz",
                            is_dir=False, sort_key=lambda x: os.path.getmtime(x))
コード例 #3
0
def full_db(location, threads, rotate):
    db.init_db_engine(config.SQLALCHEMY_DATABASE_URI)
    print("Creating full database dump...")
    path = dump.dump_db(location, threads)
    print("Done! Created:", path)

    if rotate:
        print("Removing old dumps (except two latest)...")
        remove_old_archives(location, "acousticbrainz-dump-[0-9]+-[0-9]+.tar.xz",
                            is_dir=False, sort_key=lambda x: os.path.getmtime(x))
コード例 #4
0
def full_db(location, threads, rotate):
    current_app.logger.info("Creating full database dump...")
    path = dump.dump_db(location, threads)
    current_app.logger.info("Done! Created:", path)

    if rotate:
        current_app.logger.info("Removing old dumps (except two latest)...")
        remove_old_archives(location,
                            "acousticbrainz-dump-[0-9]+-[0-9]+.tar.xz",
                            is_dir=False,
                            sort_key=lambda x: os.path.getmtime(x))
コード例 #5
0
def full_db(location, threads, rotate):
    # inits the db engine
    create_app()
    print("Creating full database dump...")
    path = dump.dump_db(location, threads)
    print("Done! Created:", path)

    if rotate:
        print("Removing old dumps (except two latest)...")
        remove_old_archives(location,
                            "acousticbrainz-dump-[0-9]+-[0-9]+.tar.xz",
                            is_dir=False,
                            sort_key=lambda x: os.path.getmtime(x))
コード例 #6
0
def _incremental_db(location, id, threads):
    print("Creating incremental database dump...")
    path = dump.dump_db(location, threads, incremental=True, dump_id=id)
    print("Done! Created: %s\n" % path)
コード例 #7
0
def _incremental_db(location, id, threads):
    current_app.logger.info("Creating incremental database dump...")
    path = dump.dump_db(location, threads, incremental=True, dump_id=id)
    current_app.logger.info("Done! Created: %s\n" % path)
コード例 #8
0
 def test_import_db_dump(self):
     path = dump.dump_db(self.temp_dir)
     self.reset_db()
     dump.import_db_dump(path)
コード例 #9
0
 def test_dump_db(self):
     path = dump.dump_db(self.temp_dir)
     self.assertTrue(os.path.isfile(path))
コード例 #10
0
 def test_import_db_dump(self):
     path = dump.dump_db(self.temp_dir)
     self.reset_db()
     dump.import_db_dump(path)
コード例 #11
0
 def test_dump_db(self):
     path = dump.dump_db(self.temp_dir)
     self.assertTrue(os.path.isfile(path))
コード例 #12
0
def _incremental_db(location, id, threads):
    print("Creating incremental database dump...")
    path = dump.dump_db(location, threads, incremental=True, dump_id=id)
    print("Done! Created: %s\n" % path)