Skip to content

Commit

Permalink
Replace hard-coded write lock filename with a named constant.
Browse files Browse the repository at this point in the history
Whitespace cleanup.
  • Loading branch information
qris committed Nov 28, 2015
1 parent 5d5ccca commit 24d8f7e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions lib/backupstore/BackupConstants.h
Expand Up @@ -11,13 +11,15 @@
#define BACKUPCONSTANTS__H

// 15 minutes to timeout (milliseconds)
#define BACKUP_STORE_TIMEOUT (15*60*1000)
#define BACKUP_STORE_TIMEOUT (15*60*1000)

// Time to wait for retry after a backup error
#define BACKUP_ERROR_RETRY_SECONDS 100
#define BACKUP_ERROR_RETRY_SECONDS 100

// Should the store daemon convert files to Raid immediately?
#define BACKUP_STORE_CONVERT_TO_RAID_IMMEDIATELY true
#define BACKUP_STORE_CONVERT_TO_RAID_IMMEDIATELY true

#define WRITE_LOCK_FILENAME "write.lock"

#endif // BACKUPCONSTANTS__H

Expand Down
4 changes: 3 additions & 1 deletion lib/backupstore/StoreStructure.cpp
Expand Up @@ -9,6 +9,7 @@

#include "Box.h"

#include "BackupConstants.h"
#include "StoreStructure.h"
#include "RaidFileRead.h"
#include "RaidFileWrite.h"
Expand Down Expand Up @@ -86,7 +87,8 @@ void StoreStructure::MakeWriteLockFilename(const std::string &rStoreRoot, int Di
RaidFileDiscSet &rdiscSet(rcontroller.GetDiscSet(DiscSet));

// Make the filename
std::string writeLockFile(rdiscSet[0] + DIRECTORY_SEPARATOR + rStoreRoot + "write.lock");
std::string writeLockFile(rdiscSet[0] + DIRECTORY_SEPARATOR + rStoreRoot +
WRITE_LOCK_FILENAME);

// Return it to the caller
rFilenameOut = writeLockFile;
Expand Down

0 comments on commit 24d8f7e

Please sign in to comment.