[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [pytorctl/master] use Elixir model delete method



commit db835ef1f6a252d9923be766f1d7dc813ea9a4eb
Author: aagbsn <aagbsn@xxxxxxxx>
Date:   Wed Aug 31 16:09:00 2011 -0700

    use Elixir model delete method
    
    try to use the same session for deletes and queries where possible,
    this may be the cause of an ObjectNotFound exception that occurs
    right after _update_db(), despite the Router object being in the
    consensus and also in the db.
---
 SQLSupport.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/SQLSupport.py b/SQLSupport.py
index 718bf35..5933707 100644
--- a/SQLSupport.py
+++ b/SQLSupport.py
@@ -1023,7 +1023,7 @@ class StreamListener(CircuitListener):
       (s.strm_id not in self.parent_handler.streams or \
            self.parent_handler.streams[s.strm_id].ignored):
       if strm:
-        tc_session.delete(strm)
+        strm.delete()
         tc_session.commit()
       return # Ignore streams that aren't ours
 
@@ -1038,7 +1038,7 @@ class StreamListener(CircuitListener):
       strm.circuit = Circuit.query.filter_by(circ_id=s.circ_id).first()
       if not strm.circuit:
         plog("NOTICE", "Ignoring prior stream "+str(strm.strm_id)+" with old circuit "+str(s.circ_id))
-        tc_session.delete(strm)
+        strm.delete()
         tc_session.commit()
         return
     else:



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits