stix2arango 1.0.3__py3-none-any.whl → 1.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of stix2arango might be problematic. Click here for more details.

@@ -220,7 +220,8 @@ class ArangoDBService:
220
220
  )
221
221
  out = [dict(zip(('id', '_key', 'modified', '_record_modified', '_is_latest', '_id'), obj_tuple)) for obj_tuple in out]
222
222
  annotated, deprecated = annotate_versions(out)
223
- self.db.collection(collection_name).update_many(annotated, sync=True, keep_none=False)
223
+ for chunk in utils.chunked(annotated, 10_000):
224
+ self.db.collection(collection_name).update_many(chunk, sync=True, keep_none=False)
224
225
  return deprecated
225
226
 
226
227
 
@@ -297,8 +298,9 @@ class ArangoDBService:
297
298
  @contextlib.contextmanager
298
299
  def transactional(self, write=None, exclusive=None, sync=True):
299
300
  original_db = self.db
300
- transactional_db = self.db.begin_transaction(allow_implicit=True, write=write, exclusive=exclusive, sync=sync)
301
+ transactional_db = self.db.begin_transaction(allow_implicit=True, write=write, exclusive=exclusive, sync=sync, lock_timeout=300)
301
302
  try:
303
+ logging.info(f"entering transaction: {transactional_db.transaction_status()}")
302
304
  self.db = transactional_db
303
305
  yield self
304
306
  transactional_db.commit_transaction()
@@ -306,4 +308,5 @@ class ArangoDBService:
306
308
  transactional_db.abort_transaction()
307
309
  raise
308
310
  finally:
311
+ logging.info(f"exiting transaction: {transactional_db.transaction_status()}")
309
312
  self.db = original_db
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stix2arango
3
- Version: 1.0.3
3
+ Version: 1.1.0
4
4
  Summary: stix2arango is a command line tool that takes a group of STIX 2.1 objects in a bundle and inserts them into ArangoDB. It can also handle updates to existing objects in ArangoDB imported in a bundle.
5
5
  Project-URL: Homepage, https://github.com/muchdogesec/stix2arango
6
6
  Project-URL: Issues, https://github.com/muchdogesec/stix2arango/issues
@@ -3,14 +3,14 @@ stix2arango/__main__.py,sha256=wbR_iO70Vld2NYiml6Kz4rH396uOiNwTtjNBl4AHZEg,1987
3
3
  stix2arango/config.py,sha256=NZFrcnEfz-0QBrut2Rh7xMF78v0bk6U6y2TY_7mHxSs,1407
4
4
  stix2arango/utils.py,sha256=heln_kXBSTLo0R4n1IrfCHbRnCHTQf9Y2URhvwQ0Smc,4845
5
5
  stix2arango/services/__init__.py,sha256=E87fB-dxI4mPxMVs00jdLhjp9jFhkVfjhMKIqGLRJlY,45
6
- stix2arango/services/arangodb_service.py,sha256=mXBQUeKR9IHErmvuZ73AiASZKawZOpuRiJQXWaN8bx8,11706
6
+ stix2arango/services/arangodb_service.py,sha256=qgE7yb-ysqyJ1oUjqAV6eGa53WvWHAFAd6I7aKZ6KyU,11960
7
7
  stix2arango/services/version_annotator.py,sha256=Sd1MIaXzK0fpNopNxRoB_3etodzAjX5D_p3uGQSWzOI,2946
8
8
  stix2arango/stix2arango/__init__.py,sha256=OqxWEEsHqR1QQpznM5DbFJ5bO5numKYtoYhjXYJMEyg,36
9
9
  stix2arango/stix2arango/bundle_loader.py,sha256=qi-0E_bMIMPZXzISvjhrWX8K-f7iFv9vOekldOGVczU,4603
10
10
  stix2arango/stix2arango/stix2arango.py,sha256=PyrDzW8YuKzibpMA0UImwpDBf1BeiP5pUz5tE_nVwG4,22073
11
11
  stix2arango/templates/marking-definition.json,sha256=0q9y35mUmiF6xIWSLpkATL4JTHGSCNyLbejqZiQ0AuE,3113
12
- stix2arango-1.0.3.dist-info/METADATA,sha256=Y_g0HMF6JKVOSw1JJz0d9n8sSH6Vtkbm9kwoh_NSTjA,6873
13
- stix2arango-1.0.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
14
- stix2arango-1.0.3.dist-info/entry_points.txt,sha256=k2WnxMsHFLoyC6rqfvjhIMS1zwtWin51-MbNCGmSMYE,58
15
- stix2arango-1.0.3.dist-info/licenses/LICENSE,sha256=BK8Ppqlc4pdgnNzIxnxde0taoQ1BgicdyqmBvMiNYgY,11364
16
- stix2arango-1.0.3.dist-info/RECORD,,
12
+ stix2arango-1.1.0.dist-info/METADATA,sha256=DHq9KWi0BV3juGOP-JLh5y9rxB-htxKu_l4vrw19fjg,6873
13
+ stix2arango-1.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
14
+ stix2arango-1.1.0.dist-info/entry_points.txt,sha256=k2WnxMsHFLoyC6rqfvjhIMS1zwtWin51-MbNCGmSMYE,58
15
+ stix2arango-1.1.0.dist-info/licenses/LICENSE,sha256=BK8Ppqlc4pdgnNzIxnxde0taoQ1BgicdyqmBvMiNYgY,11364
16
+ stix2arango-1.1.0.dist-info/RECORD,,