mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2025-02-12 13:17:18 +02:00
commit
99c20d6624
4 changed files with 22 additions and 2 deletions
|
@ -264,7 +264,20 @@ connected:
|
||||||
auto inputs = readStrings<PathSet>(source);
|
auto inputs = readStrings<PathSet>(source);
|
||||||
auto wantedOutputs = readStrings<StringSet>(source);
|
auto wantedOutputs = readStrings<StringSet>(source);
|
||||||
|
|
||||||
AutoCloseFD uploadLock = openLockFile(currentLoad + "/" + escapeUri(storeUri.render()) + ".upload-lock", true);
|
AutoCloseFD uploadLock;
|
||||||
|
{
|
||||||
|
auto setUpdateLock = [&](auto && fileName){
|
||||||
|
uploadLock = openLockFile(currentLoad + "/" + escapeUri(fileName) + ".upload-lock", true);
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
setUpdateLock(storeUri.render());
|
||||||
|
} catch (SysError & e) {
|
||||||
|
if (e.errNo != ENAMETOOLONG) throw;
|
||||||
|
// Try again hashing the store URL so we have a shorter path
|
||||||
|
auto h = hashString(HashAlgorithm::MD5, storeUri.render());
|
||||||
|
setUpdateLock(h.to_string(HashFormat::Base64, false));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
Activity act(*logger, lvlTalkative, actUnknown, fmt("waiting for the upload lock to '%s'", storeUri.render()));
|
Activity act(*logger, lvlTalkative, actUnknown, fmt("waiting for the upload lock to '%s'", storeUri.render()));
|
||||||
|
|
|
@ -2,7 +2,11 @@
|
||||||
#include "eval-inline.hh"
|
#include "eval-inline.hh"
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wswitch-enum"
|
||||||
#include <toml.hpp>
|
#include <toml.hpp>
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
#include "compression.hh"
|
#include "compression.hh"
|
||||||
#include "filetransfer.hh"
|
#include "filetransfer.hh"
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wswitch-enum"
|
||||||
#include <aws/core/Aws.h>
|
#include <aws/core/Aws.h>
|
||||||
#include <aws/core/VersionConfig.h>
|
#include <aws/core/VersionConfig.h>
|
||||||
#include <aws/core/auth/AWSCredentialsProvider.h>
|
#include <aws/core/auth/AWSCredentialsProvider.h>
|
||||||
|
@ -25,6 +27,7 @@
|
||||||
#include <aws/s3/model/ListObjectsRequest.h>
|
#include <aws/s3/model/ListObjectsRequest.h>
|
||||||
#include <aws/s3/model/PutObjectRequest.h>
|
#include <aws/s3/model/PutObjectRequest.h>
|
||||||
#include <aws/transfer/TransferManager.h>
|
#include <aws/transfer/TransferManager.h>
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
using namespace Aws::Transfer;
|
using namespace Aws::Transfer;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace Aws { namespace Client { class ClientConfiguration; } }
|
namespace Aws { namespace Client { struct ClientConfiguration; } }
|
||||||
namespace Aws { namespace S3 { class S3Client; } }
|
namespace Aws { namespace S3 { class S3Client; } }
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
|
Loading…
Add table
Reference in a new issue